Examples of CLI migration commands
In each of the following compare (-c) examples, a comparison result report is generated named Specified Object Comparison.xml.
If the --<object type> command is not included, the example is an all-object migration/comparison. The name of the comparison result file is All Object Comparison.xml.
Specified form migration/comparison
-g "Migrator Configuration.xml" -u Demo
migratorcli -c -s <sourceLocation> -d <destinationLocation> --form "Sample:Cities"
-g "Migrator Configuration.xml" -u Demo
All Form migration/comparison
-u Demo
migratorcli -c -s <sourceLocation> -d <destinationLocation> --form "" -g "Migrator Configuration.xml"
-u Demo
Specified form and all filters migration/comparison
This example show how a you can specify multiple object types on the command line. This examples includes a single form and all filters. More object types can be added if needed.
-g "Migrator Configuration.xml" -u Demo
migratorcli -c -s <sourceLocation> -d <destinationLocation> --form "Sample:Cities" -filter ""
-g "Migrator Configuration.xml" -u Demo
Specified CMDB migration/comparison
-y "CMDBMetaData.xml" -g "CMDBConfiguration.xml" -u Demo
migratorcli -c -s <sourceLocation> -d <destinationLocation> --metadata "BMC_Person" --metatype "CMDB"
-y "CMDBMetaData.xml" -g "CMDBConfiguration.xml" -u Demo
All CMDB migration/comparison
-y "CMDBMetaData.xml" -g "CMDBConfiguration.xml" -u Demo
migratorcli -c -s <sourceLocation> -d <destinationLocation> --metadata "" --metatype "CMDB"
-y "CMDBMetaData.xml" -g "CMDBConfiguration.xml" -u Demo
All object migration/comparison
migratorcli -c -s <sourceLocation> -d <destinationLocation> -g "Migrator Configuration.xml" -u Demo
Deployable applications instruction file
- <instructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=
"Migration Instructions.xsd"> - <instruction enabled="true" name="ExampleAppDeployment">
- <special-instructions>
- <!-- Used for special migrations such as Form and Related migrations and Application Deployment{
-->
<special type="deploy" name="Sample" enabled="true" />
<special type="deploy" name="Home Page" enabled="true" />
</special-instructions>
</instruction>
</instructions>
CMDB instructions
This example shows how you can migrate or compare a specific class within the CMDB system and remember to include the CMDBMetaData.xml mapping file on command line.
- <instructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=
"Migration Instructions.xsd"> - <instruction enabled="true" name="ExampleCMDB">
- <special-instructions>
- <!-- BMC_Person class and all of its sub-class will be automatically included -->
<special type="meta-data" name="BMC_Person" owner="CMDB" enabled="true" />
</special-instructions>
</instruction>
</instructions>
Data instruction file
This example shows how you can migrate or compare data between one or more forms where a query or all data can be included.
- <instructions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=
"Migration Instructions.xsd"> - <instruction enabled="true" name="ExampleData">
- <data-instructions>
- <data enabled="true" source-form="User" destination-form="User" unique-field-id="1" type="data"
mode="search" merge-option="update" ignore-required-fields="true" ignore-pattern-matching="true"
count="0" disable-related-workflow="false">{
<qualification>'Login Name' != $NULL$</qualification>
<ports enabled="true" list="390635" fast="390620" />
</data>
- <data enabled="true" source-form="Group" unique-field-id="1" type="data" mode="all"
merge-option="update" ignore-required-fields="true" ignore-pattern-matching="true" count="0"
disable-related-workflow="false">
<ports enabled="true" list="390635" fast="390620" />
</data>
</data-instructions>}
</instruction>
</instructions>
Truncating data on forms
When the destination field size is less than the source field size, an error might appear during migration. To avoid the issue, you can enable data truncation on forms. There are two methods for handling data truncation:
Setting form level data truncation
You can use the enable-truncation="true" option in the instruction.xml file to enable data truncation on all data fields on the form where the size of a destination field is less than the size of the field in the source form. If you do not set the option to true, BMC Remedy Migrator assumes false, which is the default.
Setting field level data truncation
You can enable data truncation for selected fields on the form by using the <truncate> option in the <data> tag of the instruction.xml file. To enable the feature, specify the field IDs in the <truncate> tag as shown in the following code sample:
destination-form ="TestForm" type="data" mode="search"
<qualification> 1=1 </qualification>
<unique-fields> <field Id = "1"/> </unique-fields>
<ports enabled="true" list="LIST_PORT" fast="FAST_PORT"/>
<truncate>
<field Id = "destination field ID1"/>
<field Id = "destination field ID2"/>
<field Id = "destination field ID3"/>
</truncate>
</data>
You can set the field level data truncation for character fields only. If you do not specify the character field IDs, BMC Remedy Migrator ignores the fields and continues the execution without an error or termination. The field level data truncation occurs only when the destination field size is less than the source field size.
When you enable the field level data truncation feature, BMC Remedy Migrator behaves as follows:
- When you do not add the field list --When you do not specify the field IDs in the <truncate> tag, but enable the form level data truncation, BMC Remedy Migrator evaluates each field on the destination form to decide if the data needs to be truncated. If the field requires truncation, BMC Remedy Migrator truncates data in that field.
- When you add the field list-- When you specify the field IDs in the <truncate> tag, but do not enable form level data truncation, BMC Remedy Migrator truncates data for the specified fields in the list. BMC Remedy Migrator maintains the field mappings that are specified in .arm file.
- When you enable both field level and form level data truncation --When you specify the field IDs in the <truncate> tag, and also enable the form level data truncation, BMC Remedy Migrator ignores the specified field level data truncation and only considers form level data truncation. Each field present on the destination form is evaluated to decide if the data needs to be truncated. If you specify a field ID that is not present on the destination form, BMC Remedy Migrator does not display an error message, but continues the execution.