Specifying data truncation during CLI migrations


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:

  • Form level
  • Field level

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, 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, 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.

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

When you enable the field level data truncation feature, 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, Migrator evaluates each field on the destination form to decide if the data needs to be truncated. If the field requires truncation, 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, Migrator truncates data for the specified fields in the list. 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, 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, 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*