Configure a DTS migration task to migrate data between self-managed MySQL databases on ECS instances with zero downtime.
Background
DTS supports homogeneous and heterogeneous data migrations with ETL features such as data filtering and database-, table-, and column-level mapping. DTS enables zero-downtime migrations, keeping the source database available throughout the process. For supported database types, see Data migration.
The following figure shows data migration between self-managed databases on ECS instances.
Prerequisites
-
The MySQL listening port (default: 3306) is open in the security group of the destination ECS instance.
-
The security group of the source ECS instance allows the DTS server IP address ranges for the destination instance.
-
Non-root MySQL accounts are created on the source and destination ECS instances.
For example, create a MySQL account with username
dtsand passwordTest@123456:# Step 1: Create an account and configure its password. CREATE USER 'dts'@'%' IDENTIFIED BY 'Test@123456'; # Step 2: Grant privileges. GRANT ALL PRIVILEGES ON *.* TO 'dts'@'%'; # Step 3: Flush privileges. FLUSH PRIVILEGES;
Usage notes
Supported database versions and limitations vary. See Migration scenarios.
Procedure
-
Log on to the DTS console.
-
In the left-side navigation pane, click Data Migration.
-
Select the region of the ECS instances and click Create Task.
-
Configure the source and destination databases.
-
Specify a task name.
DTS auto-generates a task name. You can specify a descriptive name. The name does not need to be unique.
-
Configure the source database.
DTS supports self-managed databases accessible over the Internet or through VPN Gateway, Express Connect, or Smart Access Gateway. This example uses Internet access. For other access methods, see Migration scenarios.
Parameter
Description
Database Type
The database type on the source ECS instance. Example: MySQL.
Access Method
The access method based on database deployment. Example: Self-managed Database on ECS.
Instance Region
The source ECS instance region. Example: China (Hangzhou).
Replicate Data Across Alibaba Cloud Accounts
Specifies whether to migrate data across Alibaba Cloud accounts. Example: No.
ECS Instance ID
The source ECS instance ID.
Port
The MySQL listening port. Default: 3306.
Database Account
The non-root MySQL account on the source ECS instance. Example:
dts.ImportantThe account must be non-root. Otherwise, the connectivity test fails.
Database Password
The account password.
-
Configure the destination database.
Parameter
Description
Database Type
The database type on the destination ECS instance. Must match the source database type. Example: MySQL.
Access Method
The access method of the destination database. Example: Self-managed Database on ECS.
Instance Region
The destination ECS instance region. Example: China (Beijing).
ECS Instance ID
The destination ECS instance ID. DTS supports instances in VPCs.
Port
The MySQL listening port. Default: 3306.
Database Account
The non-root MySQL account on the destination ECS instance. Example:
dts.NoteThe account must be non-root. Otherwise, the connectivity test fails.
Database Password
The account password.
-
If your self-managed database uses a whitelist for security, copy the DTS server IP addresses from the dialog box and add them to the whitelist of your self-managed database. Then, click Test Connectivity.
WarningAdding the public IP address blocks of DTS servers, whether automatically or manually, may introduce security risks. Using this product, you acknowledge and accept these potential risks. You must implement basic security measures, such as using strong passwords, limiting open ports for each CIDR block, using authentication for internal API calls, and regularly checking and restricting unnecessary CIDR blocks. You can also connect using an internal network, such as a leased line, VPN Gateway, or Smart Access Gateway.
-
-
Configure migration types, migration objects, and trigger migration method.
-
Configure migration types.
-
For zero-downtime migration with continuous writes to the source database, select Schema Migration, Full Data Migration, and Incremental Data Migration.
NoteIf Incremental Data Migration is not selected, do not write data to the source database during migration to ensure data consistency.
-
To migrate during downtime or when no new data is written, select Schema Migration and Full Data Migration.
-
-
Configure migration objects.
In the Source Objects list, select the objects to migrate, such as databases, tables, or columns, and click the
icon to add them to Selected Objects.NoteBy default, object names remain unchanged after migration. To rename objects in the destination database, use the object name mapping feature in DTS.
-
-
Complete the remaining configurations. Run a precheck, purchase a DTS instance, complete the payment, and start the migration task.
DTS checks connectivity, permissions, and log formats before starting the migration. The following figure shows a successful precheck.

After the precheck completes, view the migration task status and progress in the Data Migration Tasks section on the Data Migration page.
