--- title: "HOW TO - Copy a table and its metadata" slug: "how-to-copy-a-table-and-its-metadata" updated: 2024-03-22T14:55:10Z published: 2024-03-22T14:55:10Z canonical: "docs.datajet.app/how-to-copy-a-table-and-its-metadata" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.datajet.app/llms.txt > Use this file to discover all available pages before exploring further. # HOW TO - Copy a table and its metadata Tables can be copied from a source project to another (different) target [project](/v1/docs/introduction-to-projects) using [CopySourceTable](/v1/docs/copysourcetable). If [metadata](/v1/docs/getting-started-categories-and-metadata) exists on the source table in the source project, this can be added to the target table by first configuring the target project. ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1711118063479.png) The approach to bringing across metadata from a source project to a target project is as follows: 1. Obtain **project metadata configuration** from **Source Project** 2. Run **SetProjectProperties** in **Target Project** 3. Run **CopySourceTable** in the **Target Project** 4. Open the **Target Project** and verify that metadata properties appear in the Context Panel Property Pane. ### Setting up metadata in the Source Project The following shows how metadata was originally set up in the source project (BioInvestigate): 1. [CreateTableFromFile](/v1/docs/createtablefromfile) - creates table "framingham" 2. [SetProjectProperties](/v1/docs/setprojectproperties) configures project "BioInvestigate" with metadata properties Description, ObservationType and Unit 3. [SetPropertiesFromWorkbook](/v1/docs/setpropertiesfromworkbook) applies the metadata in "META_framingham_figsure.xlsx" to the project. ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1711117583176.png) ```json { "method": "CreateTableFromFile", "action": "LOAD", "table": "framingham", "filename": "%DATAPATH%04_Bio/framingham_figshare_cleaned.csv", "definition": [ "RecordNo|DISCRETE|INTEGER|BYTE", "RANDID|CONTINUOUS|INTEGER|", "SEX|DISCRETE|INTEGER|BYTE", ... "TIMEHYP|DISCRETE|INTEGER|BYTE" ], "loading": [ "RecordNo", "RANDID", "SEX", ... "TIMEHYP" ], "preHeaderSkip": 0, "dateFormat": "YYYY-MM-DD", "fileFormat": "ASCII8", "skipFirstLine": true, "delimiter": "COMMA", "stripCharacter": "", "dateTimeFormat": "YYYY-MM-DD HH:MM:SS", "sample": false, "ignoreErrors": false, "project": "{ "method": "SetPropertiesFromWorkbook", "filename": "%DATAPATH%04_Bio/META_framingham_figsure.xlsx", "delimiter": ",", "properties": [ "Description", "ObservationType", "Unit" ], "project": "BioInvestigate" }" } ``` ```json { "method": "SetProjectProperties", "categoryProperty": "ObservationType", "secondDegreeSearchProperty": "Unit", "fieldPropertyNames": [ "Description", "ObservationType", "Unit" ], "project": "BioInvestigate" } ``` ```json { "method": "SetPropertiesFromWorkbook", "filename": "%DATAPATH%04_Bio/META_framingham_figsure.xlsx", "delimiter": ",", "properties": [ "Description", "ObservationType", "Unit" ], "project": "BioInvestigate" } ``` ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1711119173646.png) ### Copying table and metadata from Source Project to Target Project The following shows how to copy a table and its metadata from one project to another 1. [SetProjectProperties](/v1/docs/setprojectproperties) configures project "BioInvestigate" with metadata properties Description, ObservationType and Unit 2. [CopySourceTable](/v1/docs/copysourcetable) copies the table and its metadata into the target project (SalesData1) ![](https://cdn.document360.io/73b6469b-c1e4-47e9-aa65-986c8ebd17ca/Images/Documentation/image-1711118636787.png) ```json { "method": "SetProjectProperties", "categoryProperty": "ObservationType", "secondDegreeSearchProperty": "Unit", "fieldPropertyNames": [ "Description", "ObservationType", "Unit" ], "project": "SalesData1" } ``` ```json { "method": "CopySourceTable", "sourceProject": "BioInvestigate", "table": "framingham", "targetName": "Bio_framingham", "allFields": true, "moveFiles": false, "project": "SalesData1" } ```