Data Transmission Service (DTS) is a data streaming service provided by Alibaba Cloud that supports data transmission between data sources such as relational, NoSQL, and online analytical processing (OLAP) databases. This topic describes how to configure migration tasks in DTS to migrate an on-premises self-managed database to an Elastic Compute Service (ECS) instance. In the examples, a MySQL database is used.

Prerequisites

  • An ECS instance is created. For more information, see Create an instance by using the wizard.
  • Rules are added to the security groups of the ECS instance to allow traffic on MySQL listening port. The default MySQL listening port is port 3306.
  • A MySQL database is created on the ECS instance.
  • A non-root account is created for the MySQL database on the ECS instance.

    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';
  • A non-root account is created for an on-premises MySQL database.

Background information

DTS supports data migration between homogeneous and heterogeneous data sources. It also supports Extract, Transform, Load (ETL) features such as data mapping at three levels (databases, tables, and columns) and data filtering. You can use DTS for zero-downtime migration to minimize the impact on your business. During data migration, the source database continues to provide services normally. 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 resides and click Create Task.
  4. Configure a migration task.
    1. Configure a task name.

      You can use the default name or specify a name.

    2. Configure the source database.

      DTS supports self-managed databases that can be accessed over the Internet or by using VPN Gateway, Express Connect, or Smart Access Gateway. In this example, a self-managed database that can be accessed over the Internet is used. For information about migration solutions for other types of databases, see DTS documentation.

      ParameterDescription
      Database TypeThe type of the on-premises self-managed database. Select MySQL.
      Access MethodThe method that is used to access the on-premises self-managed database. Select Public IP Address.
      Instance RegionThe region where the on-premises self-managed database resides.
      Hostname or IP addressThe hostname or IP address of the host where the on-premises self-managed database resides.
      Port NumberThe number of the port on which MySQL listens.
      Database AccountThe non-root account used to access the on-premises self-managed MySQL database.
      Note The account must be a non-root account. Otherwise, an error occurs when you test connectivity.
      Database PasswordThe password of the non-root account.
    3. In the lower part of the page, click Test Connectivity and Proceed.
    4. Configure the destination database.
      ParameterDescription
      Database TypeThe type of the destination database. This database type must be the same as the type of the on-premises self-managed database. Select MySQL.
      Access MethodThe method used to access the destination database. Select Self-managed Database on ECS.
      Instance RegionThe region where the ECS instance resides.
      ECS Instance IDThe ID of the ECS instance. DTS supports ECS instances that reside in the classic network and in virtual private clouds (VPCs).
      Port NumberThe number of the port on which MySQL listens.
      Database AccountThe non-root account used to access the MySQL database that is hosted on the ECS instance.
      Note The account must be a non-root account. Otherwise, an error occurs when you test connectivity.
      Database PasswordThe password of the non-root account.
      EncryptionSpecifies whether to encrypt the connection to the source database. Valid values:
      • Non-encrypted: does not encrypt the connection.
      • SSL-encrypted: encrypts the connection.
    5. In the lower part of the page, click Test Connectivity and Proceed.
  5. Configure migration types and objects.
    1. Configure the migration type.
      • To perform zero-downtime data migration, select Schema Migration, Full Data Migration, and Incremental Data Migration.
      • To perform full data migration, select 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, the object names remain the same as those in the on-premises MySQL database after the objects are migrated to a self-managed MySQL database hosted on 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. The following figure shows that the precheck succeeds.

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