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

Publishing documents to Cameo Collaborator using scripts consists of the following steps:

  1. Generate template properties files by using the template_properties_generator.bat script.
  2. 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


  1. 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/server_username=.*/server_username=%USER_NAME%/g' %templatePath%
      rem sed -i -e 's/server_password=.*/server_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 following properties to the credentials of the user who will perform document migration:

      server_username=<user_name>
      server_password=<password>
  2. 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 Optionally 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"
  3. Execute the template_properties_generator.bat script to generate template properties files.

    Example of how to execute the script
    template_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


  1. 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 Optionally 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="
  2. Execute the template_publisher.bat script to migrate Cameo Collaborator documents.

    Example of how to execute the script
    template_publisher.bat "MD_TEMPLATE_PATH=<path_to_Cameo_Collaborator_Publisher>" "GENERATED_TEMPLATE_PATH=<path_to_generated_templates>" "VERSION=<version_to_migrate_documents_to>"