Data Transmission Service (DTS) allows you to configure name mappings between source and target columns, tables, or databases that have different names. You can either define one-to-one mappings for individual objects or specify renaming rules to rename multiple objects at a time.

Limits

MongoDB supports only database name mapping and table name mapping.

Configure name mappings for individual databases, tables, and columns

  1. Create a data migration task.
  2. In the Configure Migration Types and Objects step, select the required objects into the Selected list, move the pointer over a database or table, and then click Edit next to the object. Click Edit
  3. In the dialog box that appears, specify a name for the object in the target instance.
    Note
    • If the source or target database is a user-created MySQL database, ApsaraDB RDS for MySQL, or Apsara PolarDB for MySQL, you can specify the data definition language (DDL) and data manipulation language (DML) operations that you want to replicate to the target database.
    • If different sets of operations are selected for database name mapping and table name mapping, the operations that are selected for table name mapping take precedence.
    • Database name mapping

      In the Edit Database Name dialog box, enter the database name that you want to use in the target database system.

      Specify a database name
    • Table name mapping

      In the Edit Table dialog box, enter the table name that you want to use in the target database.

      Specify a table name
    • Column name mapping

      In the Edit Table dialog box, enter a new name for each column.

      Specify a column name
      Note In this step, you can clear the selection for columns that you do not want to migrate.
  4. Click OK.
  5. Complete other configurations and continue to create a task.

Configure name mappings for multiple tables and columns at a time

  1. Create a data migration task.
  2. In the Configure Migration Types and Objects step, select the required objects into the Selected list.
    Note If the last object in your selection is a database, you cannot configure name mapping for tables or columns by using the Name batch change setting.
  3. In the lower part of the page, set the Name batch change setting to Yes, and then click Advanced Settings.Configure name mapping for multiple tables and columns at a time
  4. In the Advanced Settings step, create renaming rules for tables and columns as follows:
    1. For the Choice Range setting, select the scope of objects to which you want to apply the renaming rules. To select all objects, select All. To select specific objects, select Section, and then enter keywords to search for the desired databases (the text box in the left) and tables (the text box in the right).
    2. For the Selection Rules setting, select a renaming pattern from the drop-down list, and enter the corresponding naming element in the text box. The available renaming patterns include commonly used patterns, such as prefixing and suffixing.
    3. Click Add Modification Rules.
      Note You can repeat steps i and ii to add more rules for different tables.
    4. Click Preview to verify that the objects are renamed to the target names as expected.Preview the result of table name mapping
    5. On the Partial Preview tab, click the Down arrow icon next to the database name in the Destination Database section, and then click Column Name Modification.
    6. Configure renaming rules for column names, and then click OK. Configure mapping rules for column names
      Note
      • By default, a renaming rule applies to all column names. You can search for a specific column name and modify the renaming rule. To do this, enter the column name in the search box, and then click Search.
      • In the dialog box, you can specify conditions to filter data. For more information, see Data filtering.
    7. Click OK.
  5. Click Precheck.
  6. Complete other configurations and continue to create a task.