Default language.

Examples of CLI migration commands


In each of the following compare (-c) examples, a comparison result report is generated named Specified Object Comparison.xml.

Warning

Note

You cannot create a comparison result report for the association object.


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.

Error
Warning

If the comparison result file already exists, it is overwritten with the new file.

Specified form migration/comparison

migratorcli -m -s <sourceLocation> -d <destinationLocation> --form "Sample:Cities"
-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

Error
Warning

The "" must be specified for all items; otherwise, BMC Remedy Migrator generates an error.

migratorcli -m -s <sourceLocation> -d <destinationLocation> --form "" -g "Migrator Configuration.xml"
-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.

migratorcli -m -s <sourceLocation> -d <destinationLocation> --form "Sample:Cities" -filter ""
-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

Warning

Note

In this command sequence, the --metatype is required, because it defines the mapping to use within the mapping file CMDBMetaData.xml file.

migratorcli -m -s <sourceLocation> -d <destinationLocation> --metadata "BMC_Person" --metatype "CMDB"
-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

Warning

Note

In this command sequence, the -- metatype is required because it defines the mapping to use within the mapping file CMDBMetaData.xml.

migratorcli -m -s <sourceLocation> -d <destinationLocation> --metadata "" --metatype "CMDB"
-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 -m -s <sourceLocation> -d <destinationLocation> -g "Migrator Configuration.xml" -u Demo

migratorcli -c -s <sourceLocation> -d <destinationLocation> -g "Migrator Configuration.xml" -u Demo

Deployable applications instruction file

Warning

Note

To execute this and the next three examples, you can use the following migration or comparison command sequences:

migratorcli -m -s <sourceLocation> -d <destinationLocation> -i <instructionFileName>
-g "Migrator Configuration.xml" -u Demo

migratorcli -c -s <sourceLocation> -d <destinationLocation> -i <instructionFileName>
-g "Migrator Configuration.xml" -u Demo{*}
<?xml version="1.0" encoding="UTF-8" ?>
- <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.

<?xml version="1.0" encoding="UTF-8" ?>
- <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.

<?xml version="1.0" encoding="UTF-8" ?>
- <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>
Warning

Note

BMC Remedy Migrator updates the migration status after completion of the migration process for each schema. If a schema record failed to migrate, BMC Remedy Migrator updates the status as completed with errors, but displays the accurate status for the remaining schemas. This helps you to get the up-to-date migration status even if there is failure during the migration process or if the migration is interrupted manually.

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:

<data enabled="true" source-form="TestForm"
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.

Warning

Note

If you specify a field ID that is not present on the destination form, BMC Remedy Migrator displays a warning message indicating that the field is missing on the destination schema.


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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

Remedy Action Request System 20.02