Duplicate or "clone" a workspace

Updated at May 8th, 2024

Duplicating a new Protobi workspace can be useful to create a separate project space for a new wave of an ongoing tracker study or create a limited version for client delivery.

There are two ways to duplicate or "clone" an existing Protobi workspace.  A "Lite" clone keeps just the final data table and elements configuration from the original project.  An "Exact" clone is exactly that, it copies each and every aspect of the file, including input data tables, data processes, and elements configuration.

Create a lite clone

1) Get the primary data file from the existing project

The first step is to find and download the primary data table from the existing project. Data files will be found in the "Data" tab of project settings. This may be either a data table (blue icon) or a data process (green icon)

If your project has a data process set as "primary," then you'll want to download the result of the process and use that as the primary file for the clone.  

If the primary file is in a data table, press "Original" to download the original data file. If a data process is set as primary, press the "CSV" button to download the result of the "Process".

2) Create a new project workspace

Press the "New project..." link at the top of the main page:

Select the primary data file from the original project:

3) Set project overview

After uploading the data file, you'll be taken to the project's overview page. Give your light clone a name and brief title. Copy over the logo and image URLS from the original project if applicable. 

4) Copy elements

The next step is to copy the elements which is separate from the data table, and determines what the project looks like (i.e. question order, titles, formats, etc...).

In the original project go to the "Elements" tab and copy all of the JSON from the original project, and paste it into the same page on the new project.  Make sure to paste over the brackets that are already there and press "Save" when done. 


Use a process to pull data and elements from an existing project

Alternatively, you can skip above steps 1) and 4) by pulling data and elements from an existing project into your new project clone by using a data process. Note that this process should be created as a green table in your clone project.

Process code

/**
* @by support@protobi.com
* @created 5/8/2024
* @see (enter URL of Freshdesk support ticket or other reference)
* Define a Javascript program that calls `callback(err, rows)` when complete.
* This example below reads data from table `main`, and iterates over each row.
* Tutorial at https://help.protobi.com/advancedusers/process-data-in-protobi
*/

//2024-05-08
//Here we set update_data and update_elements to true
//You can set either or variable to false if you want to update data and not elements or vice versa
var update_data = true
var update_elements = false

//Bring in the datasetId for both the original project and the clone you just created
original_datasetId = "5a5fa2dd136a3a0004b461d0"
clone_datasetId = "6024090af862ea0003d834f6"

//Only when update_data is true will the following code run
if (update_data) {
    data = await Protobi.get_tables(original_datasetId, ["process"])  //list table(s) to bring in
                                                                      //from original project
    rows = data["process"] //Declare rows equal to the table you want to bring in
}

//Else statement will return alternate data if update_data is set to false
//Typically, you will want to return the data in the "main" table
else {
    data = await Protobi.get_tables(["main"])
    rows = data["main"] 
}

//Only when update_elements is true will the following code run
if (update_elements) {
    //Declare elements as the elements we get from the original project
    let elements = await Protobi.get_elements(original_datasetId)
    //Save the elements in the clone project with the elements from the original
    await Protobi.save_elements(clone_datasetId, elements)
}

return rows;                        // 
Delete


Open the clone project

After the "Elements" are copied over, open your clone project. It should look identical to the original project (i.e. N size, layout, colors, etc...).  


Create an exact clone

1) Download all data tables

To make an exact clone, start by downloading all data tables from the original project in their original formats. In the example below, the project only has one data table "main", but your project may have multiple data tables. 

2) Create a new project workspace

Press the "New project..." link at the top of the main page. Create a new project with the file you downloaded from the "main" data table.

3) Set project overview

After uploading the data file, you'll be taken to the project's overview page. Give your exact clone a name and brief title. Copy over the logo and image URLS from the original project if applicable. 

4) Copy any additional data tables and processes

After all the data tables are copied over to the exact clone, copy over any data processes that are in the original project. 

In the original project, press "Edit/run" for a data process. For a light clone we would download the result of a "primary" data process, but here we want to copy over the process itself. 

After pressing "Edit/run" you will be taken to a page with the data processing code. Copy everything in the code-view to your clipboard.


Make process primary

If a data process is the primary file in the original project, "Run" that data process, and make it the primary file in the exact clone. 

5) Copy documents

Upload any documents that are in the original project into the exact clone.

After all data tables, processes and documents are copied from the original project into the exact clone the "Data" tab of the two projects should appear identical. 

6) Copy elements

The last step is to copy the original "Elements" over into the exact clone. Follow the steps above

Was this article helpful?