Migrate Script File

This section offers step-by-step guidance for migrating DaVinci Configurator Version 5 Automation Interface script files to Version 6 script projects or script files in different ways:

To compile and test the migration results, see Verify Migration Result.

Prerequisites

The migration of Version 5 Automation Interface scripts requires the setup of:

License

Installation

Input

  • CFG5 script file to migrate

Assisted Migration
During migration, the Migration Assistant creates a backup copy of the input script file and transforms the input script file directly. If the parent directory of the input script file is not intended for changes, choose a more suitable location for your input script file instead.

Assisted Migration via Tool

This section describes steps for migrating Version 5 Automation Interface script files (.dvgroovy) with the help of the Migration Assistant.

Convert to CFG6 Script Project

  1. Open your CLI.

  2. Navigate to the parent directory of the Migration Assistant located inside the Version 6 installation directory (<cfg6 installation>/migration).

  3. Run pai-migration.exe dvgroovy -s <path to cfg5 script file> to start the generation of a Version 6 script project from your input CFG5 script file.

  4. If the generation of the DaVinci Configurator automation script project fails (see CLI status logs of the migration process), follow the error logs to fix your setup and re-run the generation steps once more.

Migration Assistant Help
Run pai-migration.exe -h for a more detailed overview of all supported use cases, CLI commands and parameters, and further information.

Results

If the generation of the Version 6 script project succeeds, two output directories are created in the parent directory of the input Version 5 script file:

  • A CFG6 script project with a transformed copy of the input Version 5 script file

  • A backup directory with a copy of the original input Version 5 script file

Example

Input for migration:

  • A Version 5 script file called myScript.dvgroovy

Output of migration:

  • A CFG6 script project directory called myScript which contains:

    • A transformed copy of the input Version 5 script file myScript/src/main/groovy/myScript.groovy (with migrated Version 6 imports)

    • A default test setup myScript/src/testCfg (see Automation Interface Documentation)

    • A Gradle project setup (see Automation Interface Documentation).

      myScript
          +---gradle
          |   +---...
          +---src
          |   +---main
          |   |   +---groovy
          |   |   |   +---myScript.groovy
          |   +---testCfg
          |   |   +---...
          +---build.gradle
          +---gradlew
          +---gradlew.bat
          +---settings.gradle
  • A backup directory called myScript_legacy_backup which contains:

    • A copy of the input CFG5 script file (see myScript.dvgroovy)

      myScript_legacy_backup
          +---myScript.dvgroovy

Adapt Script Code

  1. Open the Version 6 script project (migrated in Convert to CFG6 Script Project) in your IDE.

  2. Open the new .groovy script located inside the directory <script project>/src/main/groovy.

  3. Renew outdated or missing imports of Automation Interface APIs.

  4. Rewrite outdated script code that could not be automatically translated to the newly imported Automation Interface APIs.

  • Use your IDE to quickly find and import new packages and give hints about warnings and incompatibilities. IntelliJ IDEA offers highlighting of affected areas.

  • Check the sections API Changes and API Changes Reference to get a detailed overview of changed API references.

Manual Migration

This section describes steps for migrating DaVinci Configurator Version 5 Automation Interface script files (.dvgroovy) manually.

Convert to Version 6 Script File

  1. Change the file extension of your .dvgroovy script file to .dv.groovy.

Adapt Script Code

  1. Open the new .dv.groovy script file in your IDE.

  2. Renew outdated imports of Automation Interface APIs.

  3. Rewrite outdated script code.