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 Linux 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.sh and template_publisher.sh script files.
Migrating Cameo Collaborator documents using scripts consists of the following steps:
- Generate template properties files by using the template_properties_generator.sh script.
- Migrate documents by using the generated template properties files and the template_publisher.sh script.
Generating template properties files
Use the the template_properties_generator.sh 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.sh file and uncomment the following lines (remove the # symbol):
#sed -ri "s%username=.+$%username=$USER_NAME%" $templatePath #sed -ri "s%password=.+$%password=$PASSWORD%" $templatePath #sed -ri "s%#encryptPassword=.+$%encryptPassword=true%" $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.sh file specify the following properties (you can skip this step and specify the required properties when running the script):
# Specify the version you want to migrate documents to. The default value is 2021x. VERSION=${VERSION:-'2021x'} # Optionally specify the Teamwork Cloud user name. The default value is Administrator. USER_NAME=${USER_NAME:-"Administrator"} # Optionally specify the Teamwork Cloud user password. The default value is Administrator. PASSWORD=${PASSWORD:-"Administrator"} # Specify the Teamwork Cloud server IP address. TWC_IP=${TWC_IP} # Specify the path to the modeling tool template properties directory. # The path should be <modeling_tool_installation_directory>/plugins/com.nomagic.collaborator.publisher MD_TEMPLATE_PATH=${MD_TEMPLATE_PATH} # Specify the path to the directory where the generated template properties files should be saved. GENERATED_TEMPLATE_PATH=${GENERATED_TEMPLATE_PATH}
Execute the template_properties_generator.sh script to generate template properties files.
Example of how to execute the scriptGENERATED_TEMPLATE_PATH=<path_to_directory_for_generated_templates> TWC_IP=<TWC_IP_or_domain> MD_TEMPLATE_PATH=<Path_to_Cameo_Collaborator_Publisher> VERSION=<version_to_migrate_documents_to> ./ template_properties_generator.sh
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.sh script.
It is recommended to distribute the template properties files to several virtual machines and run the template_publisher.sh script in parallel.
To migrate Cameo Collaborator documents
Open the template_publisher.sh file and specify the following properties (you can skip this step and specify the required properties when running the script):
# Specify the version you want to migrate documents to. The default value is 2021x. VERSION=${VERSION:-'2021x'} # Specify the path to the modeling tool template properties directory. # The path should be <modeling tool installation directory>/plugins/com.nomagic.collaborator.publisher MD_TEMPLATE_PATH=${MD_TEMPLATE_PATH} # Specify the path to the directory where the generated template properties files are saved. GENERATED_TEMPLATE_PATH=${GENERATED_TEMPLATE_PATH}
Execute the template_publisher.sh script to migrate Cameo Collaborator documents.
Example of how to execute the scriptGENERATED_TEMPLATE_PATH=<path_to_generated_templates> TWC_IP=<TWC_IP_or_domain> MD_TEMPLATE_PATH=<path_to_Cameo_Collaborator_Publisher> VERSION=<version_to_migrate_documents_to> ./template_publisher.sh