Use Data Transmission Service (DTS) to migrate a self-managed MySQL database to ApsaraDB RDS for MySQL over a private network connection (Express Connect, VPN Gateway, or Smart Access Gateway). DTS supports schema migration, full data migration, and incremental data migration. Combining all three migration types keeps your application running during the migration and minimizes downtime during the final cutover.
Choose a migration approach
| Goal | Migration types to select | Notes |
|---|---|---|
| One-time migration with a maintenance window | Schema migration + full data migration | Stop writes to the source before starting. Wait for the task to complete automatically — do not stop it manually. |
| Continuous replication with near-zero downtime cutover | Schema migration + full data migration + incremental data migration | Keeps source and destination in sync until you are ready to switch. Requires binary logging on the source. |
Prerequisites
Before you begin, make sure you have:
A self-managed MySQL database running MySQL 5.1, 5.5, 5.6, 5.7, or 8.0
An on-premises network connected to Alibaba Cloud over Express Connect, VPN Gateway, or Smart Access Gateway
An ApsaraDB RDS for MySQL or RDS MySQL Serverless instance with enough free storage to hold all source data
A database account for the self-managed MySQL database with the required permissions (see Permissions required)
A database account for the RDS instance with read and write permissions
Binary logging enabled on the self-managed MySQL database, if you plan to use incremental data migration
For setup instructions, see:
Permissions required
| Database | Schema migration | Full data migration | Incremental data migration |
|---|---|---|---|
| Self-managed MySQL | SELECT | SELECT | REPLICATION SLAVE, REPLICATION CLIENT, SHOW VIEW, SELECT |
| ApsaraDB RDS for MySQL | Read and write | Read and write | Read and write |
During schema migration, DTS changes the SECURITY attribute of views, stored procedures, and functions from DEFINER to INVOKER. DTS does not migrate user accounts. To call a view, stored procedure, or function on the destination, grant the required permissions to INVOKER manually.
For instructions on creating accounts and granting permissions, see:
Billing
| Migration type | Task configuration fee | Internet traffic fee |
|---|---|---|
| Schema migration + full data migration | Free | Charged only when data is migrated from Alibaba Cloud over the Internet. See Billing overview. |
| Incremental data migration | Charged. See Billing overview. | — |
Limitations
Table structure: Tables must have PRIMARY KEY or UNIQUE constraints, and all fields must be unique. Otherwise, the destination may contain duplicate records.
FLOAT/DOUBLE precision: DTS uses the
ROUND(COLUMN,PRECISION)function. If no precision is specified, DTS defaults to 38 digits for FLOAT and 308 digits for DOUBLE. Verify that these defaults meet your requirements before migrating.Destination database creation: DTS automatically creates the destination database. If the source database name does not comply with RDS naming rules, create the database manually before configuring the migration task.
Tablespace size after full migration: Concurrent INSERT operations during full data migration cause table fragmentation, so the destination tablespace will be larger than the source. Run
OPTIMIZE TABLEafter migration if needed.Task resumption: If a migration task fails, DTS automatically resumes it. Stop or release the task before switching workloads to the destination. Otherwise, the resumed task will overwrite data in the destination.
Performance impact: Full data migration consumes read and write resources on both the source and destination. Run migrations during off-peak hours when CPU utilization on both databases is below 30%.
SQL operations supported during incremental data migration
| Operation type | SQL statements |
|---|---|
| DML | INSERT, UPDATE, DELETE, REPLACE |
| DDL | ALTER TABLE, ALTER VIEW, CREATE FUNCTION, CREATE INDEX, CREATE PROCEDURE, CREATE TABLE, CREATE VIEW, DROP INDEX, DROP TABLE, RENAME TABLE, TRUNCATE TABLE |
Create a migration task
Log on to the DTS console.
If you are redirected to the Data Management (DMS) console, click the
icon in the
to go back to the DTS console.In the left-side navigation pane, click Data Migration.
At the top of the Migration Tasks page, select the region where the destination RDS instance resides.
In the upper-right corner, click Create Migration Task.
Configure the source and destination databases.
Section Parameter Description N/A Task name DTS generates a name automatically. Specify a descriptive name to make the task easier to identify. Task names do not need to be unique. Source database Instance type Select User-Created Database Connected over Express Connect, VPN Gateway, or Smart Access Gateway. Instance region Select the region of the virtual private cloud (VPC) connected to Express Connect, VPN Gateway, or Smart Access Gateway. Peer VPC Select the VPC connected to Express Connect, VPN Gateway, or Smart Access Gateway. Database type Select MySQL. IP address Enter the endpoint used to access the self-managed MySQL database. Port number Enter the service port. The default is 3306. Database account Enter the account for the self-managed MySQL database. Database password Enter the account password. After entering the password, click Test Connectivity to verify the connection. If the test passes, Passed appears. If it fails, click Check to view and fix the issue. Destination database Instance type Select RDS Instance. Instance region Select the region where the RDS instance resides. RDS instance ID Select the ID of the RDS instance. Database account Enter the account for the RDS instance. Database password Enter the account password. After entering the password, click Test Connectivity to verify the connection. Encryption Select Non-encrypted or SSL-encrypted. To use SSL encryption, enable SSL on the RDS instance before configuring the task. 
In the lower-right corner, click Set Whitelist and Next.
WarningAdding DTS server CIDR blocks to your database whitelist or ECS security group rules creates security risks. Before proceeding, take preventive measures: use strong passwords, limit exposed ports, authenticate API calls, and regularly audit whitelist rules. Alternatively, connect the database to DTS over Express Connect, VPN Gateway, or Smart Access Gateway.
Select migration types and objects.
Setting Description Select migration types For one-time migration, select Schema Migration and Full Data Migration. For near-zero downtime migration, also select Incremental Data Migration. If Incremental Data Migration is not selected, stop all writes to the source during full data migration to maintain data consistency. Select objects In the Available section, select the columns, tables, or databases to migrate, then click
to move them to the Selected section. By default, object names in the destination match the source. To rename objects, use the object name mapping feature. Renaming an object may cause dependent objects to fail migration.Retry time range If DTS loses connection to the source or destination, it retries for up to 720 minutes (12 hours) by default. Adjust this based on your requirements. If DTS reconnects within the retry window, the task resumes automatically. DTS charges for the instance during the retry period. Copy temporary tables (DMS online DDL) If you use Data Management (DMS) to run online DDL operations on the source, select Yes to also migrate temporary tables generated by online DDL (this may extend migration time significantly), or select No to migrate only the original DDL data (tables in the destination may be locked). 
In the lower-right corner, click Precheck.
DTS runs a precheck before starting the migration. The task can only start after passing the precheck. If any item fails, click the
icon next to it to view details. Fix the issues and run the precheck again, or ignore failed items and run the precheck again if they are not blocking.After the task passes the precheck, click Next.
In the Confirm Settings dialog box, specify the Channel Specification and select Data Transmission Service (Pay-As-You-Go) Service Terms.
Click Buy and Start.
Stop the migration task and switch workloads
Schema migration + full data migration only
Wait for the task to complete automatically. Do not stop the task manually — doing so may leave the destination data incomplete.
Schema migration + full data migration + incremental data migration
Incremental migration does not stop automatically. Follow these steps to cut over safely:
Wait until the progress bar shows Incremental Data Migration and The migration task is not delayed.
Stop all writes to the source database and wait a few minutes.
Wait until the progress bar shows The migration task is not delayed again, confirming that all remaining changes have been applied.
Manually stop the migration task.

Update your application connection strings to point to the destination RDS instance.
Stop the task during off-peak hours or just before switching workloads to minimize risk.
Post-migration checklist
After switching workloads to the destination RDS instance, complete the following:
Verify application connectivity: Confirm that your application can connect to the RDS instance and that queries return expected results.
Recreate user accounts and permissions: DTS does not migrate user accounts. Recreate the necessary accounts and grant the required permissions on the destination database.
Check views, stored procedures, and functions: DTS changes the SECURITY attribute from DEFINER to INVOKER. Grant INVOKER the necessary permissions to call these objects.
Optimize tables (if needed): Full data migration may cause table fragmentation. Run
OPTIMIZE TABLEon affected tables to reclaim space.Release the DTS task: After confirming the migration is complete, stop and release the DTS instance to avoid unnecessary charges.