Data Transmission Service (DTS) is a data streaming service provided by Alibaba Cloud that supports data transmission between data sources, such as Relational Database Management System (RDBMS), NoSQL, and Online Analytical Processing (OLAP) databases. This topic describes how to configure a DTS migration task to migrate data between self-managed databases that are hosted on Elastic Compute Service (ECS) instances. In this topic, MySQL databases are used.
Prerequisites
- The port on which MySQL listens is opened in the security groups of the destination ECS instance. The default port on which MySQL listens is 3306.
- Non-root accounts are created for the MySQL databases on the source and destination ECS instances.
For example, you can run the following command to create a MySQL account whose username is dts and password is 123456:
grant all on *.* to 'dts'@'%' IDENTIFIED BY '123456';
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
- Log on to the DTS console.
- In the left-side navigation pane, click Data Migration.
- Select the region where the ECS instances reside and click Create Task.
- Configure the parameters to create a migration task.
- Enter a name for the task.
You can use the default name or specify a name.
- Configure the source database. The following table describes the parameters about 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 topic, self-managed databases that are accessed over the Internet are used. For information about how to migrate the data of other types of databases, see the DTS documentation.
Parameter | Description |
---|
Database Type | The type of the source database. In this example, Database Type is set to MySQL. |
Access Method | The method used to access the source database. In this example, Access Method is set to Self-managed Database on ECS. |
Instance Region | The region where the source ECS instance resides. |
Replicate Data Across Alibaba Cloud Accounts | Specifies whether to configure the task to migrate or synchronize data between instances that belong to different Alibaba Cloud accounts. In this example, Replicate Data Across Alibaba Cloud Accounts is set to No. |
ECS Instance ID | The ID of the source ECS instance. |
Port Number | The number of the port on which MySQL listens. |
Database Account | The non-root account that is used to access the source MySQL database.
Note The account must be a non-root account. Otherwise, an error occurs when you test connectivity. |
Database Password | The password of the non-root account. |
Encryption | Specifies whether to encrypt the connection to the source ECS instance. In this example, Encryption is set to SSL-encrypted. Valid values: - Non-encrypted: does not encrypt the connection to the ECS instance.
- SSL-encrypted: encrypts the connection to the ECS instance.
|
- In the lower part of the page, click Test Connectivity and Proceed.
- Configure the destination database. The following table describes the parameters about the destination database.
Parameter | Description |
---|
Database Type | The type of the destination database. The value must be the same as the type of the source database. In this example, Database Type is set to MySQL. |
Access Method | The method used to access the source database. In this example, Access Method is set to Self-managed Database on ECS. |
Instance Region | The region where the destination ECS instance resides. |
ECS Instance ID | The ID of the destination ECS instance. DTS supports ECS instances that reside in the classic network and in virtual private clouds (VPCs). |
Port Number | The number of the port on which MySQL listens. |
Database Account | The non-root account that is used to access the destination MySQL database.
Note The account must be a non-root account. Otherwise, an error occurs when you test connectivity. |
Database Password | The password of the non-root account. |
Encryption | Specifies whether to encrypt the connection to the destination ECS instance. In this example, Encryption is set to SSL-encrypted. Valid values: - Non-encrypted: does not encrypt the connection to the ECS instance.
- SSL-encrypted: encrypts the connection to the ECS instance.
|
- In the lower part of the page, click Test Connectivity and Proceed.
- Configure migration types and migration objects.
- 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 Schema Migration and Full Data Migration.
- Configure migration objects.
In the Available section, select the database objects that you want to migrate, such as databases, tables, or columns. Then, click the > icon to add the objects to the Selected section.
Note By default, the object names remain the same as those in the source MySQL database after the objects are migrated to the destination MySQL database. If a migration object has different names in the source and destination databases, you must use the object name mapping feature provided by DTS. For more information, see
Object name mapping.
- Click Precheck.
Before the migration task starts, DTS checks items such as connectivity, permissions, and log formats. The message shown in the following figure indicates that the precheck succeeds.
If the precheck succeeds, you can view the status and progress of the migration task on the
Data Migration page.
