by ZD (@zsvoboda)
The CL Tool 1.2.28 introduced the new project cloning capability. There are two new project export and import commands:
ExportProject(tokenFile="...", exportUsers="...", exportData="...", authorizedUsers="...")
and
ImportProject(tokenFile="...")
As you can guess the ExportProject exports the whole content and stores it on a protected storage (you don’t have direct access to it). The exported project is identified by a token that the command stores in the tokenFile. You can also define if you wish to export the source project’s users (exportUsers="true") and data (exportData="true"). The optional authorizedUsers parameter can specify other GoodData users (comma separated) who will have access to the exported content. The user who is exporting a project has access to it by default.
The ImportProject command imports a previously exported project to a new empty project. The command needs the tokenFile file that contains a valid import token generated by the ExportProject command. The import tokens expire after 48 hours.
Both ExportProject and ImportProject work in a project context. You can create, use or open a new project with the CreateProject, OpenProject, or UseProject commands. Here is an example of the complete project cloning script:
# Open an existing project
OpenProject(id="<your-project-md5-here>");
# Export the project with data and users. Save the import token to importToken.txt file
ExportProject(tokenFile="importToken.txt", exportUsers="true", exportData="true");
# Create new empty project
CreateProject(name="Clone");
# Import the project metadata, data, and users to the new project.
ImportProject(tokenFile="importToken.txt");
The logged user must be associated with the admin role to be able to invoke the API.
If you are not sure in using the CL Tool, you can do the same thing using our so called grey pages. Go to the project maintenance section that is located on the following url:
https://secure.gooddata.com/gdc/md/<project-id>/maintenance
Here you are able to export the project. The system will generate a unique token that you will use lately to import project (store that token somewhere!). You have to create new, empty project and go to the same maintenance grey pages section, but this time choose import. You need to paste that unique token and the exported project will be imported to the new empty project.
You can choose from same options as you can using the CL Tool.