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
-
DaVinci Configurator6 (see Licenses)
Installation
-
DaVinci Configurator6 (see Installation)
-
CLI (e.g. CMD, PowerShell, Bash)
-
IDE (see Automation Interface Documentation)
-
JDK (see Automation Interface Documentation)
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
-
Open your CLI.
-
Navigate to the parent directory of the Migration Assistant located inside the Version 6 installation directory (
<cfg6 installation>/migration). -
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. -
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
myScriptwhich 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_backupwhich contains:-
A copy of the input CFG5 script file (see
myScript.dvgroovy)myScript_legacy_backup +---myScript.dvgroovy
-
Adapt Script Code
-
Open the Version 6 script project (migrated in Convert to CFG6 Script Project) in your IDE.
-
Open the new
.groovyscript located inside the directory<script project>/src/main/groovy. -
Renew outdated or missing imports of Automation Interface APIs.
-
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
.dvgroovy) manually.
Convert to Version 6 Script File
-
Change the file extension of your
.dvgroovyscript file to.dv.groovy.
Adapt Script Code
-
Open the new
.dv.groovyscript file in your IDE. -
Renew outdated imports of Automation Interface APIs.
-
Rewrite outdated script code.
-
Check the sections API Changes and API Changes Reference to get a detailed overview of changed API references.
-
If you’re interested in automatically resolving outdated imports, check the section Migrate Script File Imports