Data Transmission Service (DTS) is an Alibaba Cloud data service that supports data exchange between multiple data sources, such as Relational Database Management System (RDBMS), NoSQL, and Online Analytical Processing (OLAP) databases. This topic describes how to configure a migration task with DTS to migrate data between databases on ECS instances. A MySQL database is used in the examples.

Prerequisites

  • The MySQL listener port is enabled in security groups of the destination instance. The default listener port of the MySQL database is 3306.
  • Non-root accounts are created on the source and destination instances.

    For example, you can run the following command to create an account with its username as dts and password as 123456 for the MySQL database:

    grant all on *.*  to 'dts'@'%'  IDENTIFIED BY '123456';

Background information

DTS supports data migration between homogeneous and heterogeneous data sources. It also supports ETL features such as data mapping at three levels (databases, tables, and columns) and data filtering. You can use DTS for zero-downtime data migration. During data migration, the source database continues to provide services normally, minimizing the impact of data migration on your business. For more information about the database types supported by DTS, see Data migration.

Procedure

  1. Log on to the DTS console.
  2. In the left-side navigation pane, click Data Migration.
  3. Select the region where the ECS instance is located and click Create Migration Task.
  4. Configure the migration task.
    1. Configure a task name.

      You can use the default name or customize a name.

    2. Configure the source database.
      Parameter Description
      Instance Type The user-created database on the ECS instance.
      Instance Region The region in which the source ECS instance is located.
      ECS Instance ID The ID of the source ECS instance. DTS supports ECS instances of the classic network and VPC types.
      Database Type The type of the user-created database on the source ECS instance. The database type is MySQL in this example.
      Port Number The listener port number of the MySQL database.
      Database Account The non-root account to access the MySQL database on the source ECS instance.
      Note The account must be a non-root account. Otherwise, an error will occur when you test connectivity.
      Database Password The password of the non-root account.
    3. Click Test Connectivity in the lower-right corner of the Source Database section.
      If Test Passed is returned, the connection to the source database is normal.
    4. Configure the destination database.
      Parameter Description
      Instance Type The user-created database on the ECS instance.
      Instance Region The region in which the destination ECS instance is located.
      ECS Instance ID The ID of the destination instance. DTS supports ECS instances of the classic network and VPC types.
      Database Type The database type is the same as that of the user-created database on the source instance. The database type is MySQL in this example.
      Port Number The listener port number of the MySQL database.
      Database Account The non-root account to access the MySQL database on the destination ECS instance.
      Note The account must be a non-root account. Otherwise, an error will occur when you test connectivity.
      Database Password The password of the non-root account.
    5. Click Test Connectivity in the lower-right corner of the Destination Database section.
      If Test Passed is returned, the connection to the source database is normal.
    6. Click Set Whitelist and Next.
  5. Configure migration types and objects.
    1. Configure migration types.
      • To perform zero-downtime data migration, select Schema Migration, Full Data Migration, and Incremental Data Migration.
      • To perform full data migration, select both Schema Migration and Full Data Migration.
    2. Configure migration objects.

      In the Available list, select the database objects to be migrated, such as databases, tables, or columns. Then click the > icon to add them to the Selected list.

      Note By default, object names will remain the same as they were in the local MySQL database after they have been migrated to a user-created MySQL database in an ECS instance. If the name of a migrated object is different in the source and destination instances, you must use the object name mapping feature provided by DTS. For more information, see Object name mapping.
  6. Click Precheck.

    Before the migration task starts, DTS checks items such as connectivity, permissions, and log formats.

    If the precheck is successful, you can view the status and progress of the migration task in the Migration Tasks section.