Skip to main content
Copying a Project creates another Project with the same Ontology and settings. You also have the option to copy over the same users, datasets and models (which are not copied over by default).
For Projects that support workflow_v3, you can copy a Project in the background with copy_project_start(). See Copy a Project Asynchronously.
The copy_project() method takes the following parameters, all of which are optional:
  • copy_datasets: when set to True, the Datasets from the original Project are attached to the new Project and new tasks are created from them. To choose how Datasets are handled, pass CopyDatasetOptions instead. See Datasets, Files, and custom metadata in copied Projects.
  • Copy_collaborators: when set to True, the collaborators from the original Project will be copied over with their existing roles.
  • Copy_models: when set to True, the models and their training data from the original Project will be copied over.
The parameters above are set to False by default, which means that they don’t need to be included if a given feature shouldn’t be copied to the new Project. The copy_project() method returns the <project_hash> of the new project.
If collaborators are not copied, reviewer and label mapping settings are not copied over either.

Datasets, Files, and custom metadata in copied Projects

Copying a Project never copies your Files. Every Project, whether it is the original or a copy, uses the same Files in your Folders. Custom metadata (clientMetadata) is stored on each File. This means that custom metadata is shared between the original Project and the copy, whichever option you choose. If you update the custom metadata of a File, both Projects show the change. You never need to update custom metadata in two places. copy_datasets accepts True or a CopyDatasetOptions object. The action field of CopyDatasetOptions decides what happens to Datasets:
  • CopyDatasetAction.ATTACH (default, same as copy_datasets=True): The Datasets of the original Project are attached to the new Project. No new Dataset is created. Both Projects share the same Datasets and the same data units.
  • CopyDatasetAction.CLONE: A new Dataset is created and attached to the new Project. Only the data units you list in datasets_to_data_hashes_map are added to the new Dataset, as new data units. Each new data unit points to the same File as the data unit it was cloned from. You can clone up to 10,000 data units in one copy.
Folder IDs: Projects do not have Folder IDs. A Dataset only has a Folder ID (backing_folder_uuid) if it is a mirrored Dataset. Each File has its own ID (uuid) and the ID of the Folder it is in (parent).
  • With ATTACH, both Projects use the same Dataset, so the Dataset has the same backing_folder_uuid in both Projects.
  • With CLONE, the new Dataset has no backing Folder, so its backing_folder_uuid is None. The Files behind it still sit in their original Folders, and their custom metadata is the same as in the original Project.
If the data in two Projects comes from Files in different Folders, those are different Files. For example, the same image was uploaded twice. Each File has its own custom metadata, so you must update each File separately. To check whether two data units use the same File, compare their backing_item_uuid values.
To keep custom metadata consistent across Projects, import and update custom metadata on Files in Folders. See Import custom metadata.
Copying a Project in the Encord app attaches the original Datasets (ATTACH). To clone data units into a new Dataset, use the SDK.

Copy a Project

The project hash can be found within the URL once a project has been selected:
app.encord.com/projects/view/<project_hash>/summary
app.us.encord.com/projects/view/<project_hash>/summary
The sample code below demonstrates how to copy a Project in the most simple way.
The sample code below demonstrates how to copy a project in a more advanced way.

Copy a Project Asynchronously

Asynchronous copying requires version 0.2.2 or later of the encord SDK. It works only for Projects that support workflow_v3. To check, use project.has_workflow_v3. To copy other Projects, use copy_project().
copy_project_start() starts a copy in the background and returns a ProjectCopyJob at once. To wait for the copy to finish and get the new Project, call wait_for_project() on the job. You can access the new Project only after the copy succeeds. copy_project_start() takes the following parameters:
copy_project_start() does not copy models, and copy_labels does not filter labels. To copy only labels with a certain status or ID, use copy_project() with CopyLabelsOptions.

Choose the data to copy

Pass one of the following as data. As with copy_project(), Files are never copied. See Datasets, Files, and custom metadata in copied Projects. All three classes, and ProjectCopyFile, are imported from encord.project_copy.

Wait for a copy

wait_for_project() waits for up to 1 hour by default. To change this, pass timeout_seconds. To wait with no time limit, pass timeout_seconds=None. wait_for_project() raises the following errors. All of them are imported from encord.project_copy. Each error has a job_id attribute, so you can check on the copy later.

Check on a copy or resume later

A copy keeps running after your script exits. To check on it later, save the job ID (job.job_id). Then get the job again with user_client.get_project_copy_job(). Use the same user that started the copy. job.get_status() returns a ProjectCopyResult. Its status is one of:
  • ProjectCopyStatus.PENDING: The copy is still running.
  • ProjectCopyStatus.DONE: The copy succeeded. project_id holds the new Project’s ID.
  • ProjectCopyStatus.FAILED: The copy failed. error holds the reason.
  • ProjectCopyStatus.UNKNOWN: The SDK does not recognize the status. raw_status holds the status that Encord returned. Upgrade the SDK.
By default, get_status() checks once and returns at once. To wait up to a set time for the copy to finish, pass timeout_seconds. If the wait ends first, get_status() returns PENDING. The copy is not cancelled.
A job returned by copy_project_start() has the new Project’s ID in job.project_id. A job returned by get_project_copy_job() does not: job.project_id is None. Read the ID from the result of get_status() instead.