After upgrading Cameo Collaborator for Teamwork Cloud from version 19.0-19.0 SP4 to version 2021x or a later, you need to migrate all the published Cameo Collaborator documents to a new version as well. This chapter explains how to perform an automated Cameo Collaborator document migration on Windows OS from the command-line interface using scripts. The workflow described below will update all the documents in the Teamwork Cloud server using the whole model as a scope.
Prerequisites
- Make sure that the virtual machine where the scripts are executed has a modeling tool with the Cameo Collaborator Publisher plugin installed.
- Download the template_properties_generator.bat and template_publisher.bat script files.
Publishing documents to Cameo Collaborator using scripts consists of the following steps:
- Generate template properties files by using the template_properties_generator.bat script.
- Migrate documents by using the generated template properties files and the template_publisher.bat script.
Generating template properties files
Use the the template_properties_generator.bat script to generate template properties files as described below.
To generate template properties files
- Specify the credentials of the user who will migrate Cameo Collaborator documents by doing one of the following:
If you are the user who will migrate documents, open the template_properties_generator.bat file and uncomment the following lines:
rem sed -i -e 's/username=.*/username=%USER_NAME%/g' %templatePath% rem sed -i -e 's/password=.*/password=%PASSWORD%/g' %templatePath%
If you are NOT the user who will migrate documents, open the <modeling_tool_install_directory>\plugins\com.nomagic.collaborator.publisher\template.properties file and change the values of the username and password properties to the credentials of the user who will perform document migration. Then uncomment the encryptPassword property and set it to true.
username=<userName> password=<passWord> encryptPassword=true
In the template_properties_generator.bat file specify the following properties (you can skip this step and specify the required properties when running the script):
rem Specify the version you want to migrate documents to. The default value is 2021x. set "VERSION=2021x" rem Optionally specify the Teamwork Cloud user name. The default value is Administrator. set "USER_NAME=Administrator" rem Optionally specify the Teamwork Cloud user password. The default value is Administrator. set "PASSWORD=Administrator" rem Specify the Teamwork Cloud server IP address. set "TWC_IP=" rem Specify the path to the modeling tool template properties directory. rem The path should be <modeling_tool_installation_directory>\plugins\com.nomagic.collaborator.publisher directory set "MD_TEMPLATE_PATH=" rem Specify the path to the directory where the generated template properties files should be saved. set "GENERATED_TEMPLATE_PATH=" rem Set to true to log collected parameters to console. set "LOG=false"
Execute the template_properties_generator.bat script to generate template properties files.
Example of how to execute the scripttemplate_properties_generator.bat "TWC_IP=<TWC_IP_or_domain>" "MD_TEMPLATE_PATH=<path_to_Cameo_Collaborator_Publisher>" "GENERATED_TEMPLATE_PATH=<path_to_directory_for_generated_templates>" "VERSION=<version_to_migrate_documents_to>"
Migrating Cameo Collaborator documents
Once you generate template properties files as described in the previous section, you can migrate Cameo Collaborator documents by using the template_publisher.bat script.
It is recommended to distribute the template properties files to several virtual machines and run the template_publisher.bat script in parallel.
To migrate Cameo Collaborator documents
Open the template_publisher.bat file and specify the following properties (you can skip this step and specify the required properties when running the script):
rem Specify the version you want to migrate documents to. The default value is 2021x. set "VERSION=2021x" rem Specify the path to the modeling tool template properties directory. rem The path should be <modeling_tool_installation_directory>\plugins\com.nomagic.collaborator.publisher directory set "MD_TEMPLATE_PATH=" rem Specify the path to the directory where the generated template properties files are saved. set "GENERATED_TEMPLATE_PATH="
Execute the template_publisher.bat script to migrate Cameo Collaborator documents.
Example of how to execute the scripttemplate_publisher.bat "MD_TEMPLATE_PATH=<path_to_Cameo_Collaborator_Publisher>" "GENERATED_TEMPLATE_PATH=<path_to_generated_templates>" "VERSION=<version_to_migrate_documents_to>"