Data Transmission Service (DTS) migrates data from a PolarDB-X 1.0 instance to an ApsaraDB RDS for MySQL instance with minimal downtime. DTS supports schema migration, full data migration, and incremental data migration, so your application can stay online throughout the process.
Prerequisites
Before you begin, make sure that you have:
A PolarDB-X 1.0 source instance (version 5.2 or later) with ApsaraDB RDS for MySQL as its storage type. PolarDB for MySQL cannot be used as the storage type.PolarDB-X 1.0
An ApsaraDB RDS for MySQL destination instance with available storage larger than the total data size in the source instance.
Database accounts with the required permissions. See Permissions required for database accounts.
For incremental data migration: binary logging enabled on the source instance, with
binlog_row_imageset tofull. The character set of the data to migrate must not be utf8mb3.
Billing
| Migration type | Instance fee | Internet traffic fee |
|---|---|---|
| Schema migration, full data migration | Free | Charged when Access Method is set to Public IP Address. See Billing overview. |
| Incremental data migration | Charged. See Billing overview. | — |
Limitations
Source database requirements
The server must have sufficient outbound bandwidth. Low bandwidth reduces migration speed.
Tables must have PRIMARY KEY or UNIQUE constraints with all fields unique. Tables without these constraints may produce duplicate records in the destination.
If you rename tables or columns during migration, a single task supports up to 1,000 tables. For more than 1,000 tables, split the workload across multiple tasks or migrate the entire database instead.
Do not modify the source during migration: avoid upgrading or downgrading the instance, migrating frequently-updated tables, changing shard keys, or running DDL operations. Any of these will cause the migration task to fail.
If you change the network type of the PolarDB-X 1.0 instance during migration, update the network connection settings of the migration task to match.
For full data migration only: do not write data to the source during migration. Writing to the source during a full-only migration causes data inconsistency.
For incremental data migration, configure the following before you start:
Binary logging must be enabled and
binlog_row_imagemust be set tofull. DTS fails the precheck if this is not set.Binary log retention must meet the minimum duration: If DTS cannot read the binary logs, the task fails and data inconsistency or loss may occur. After full data migration completes, you can reduce the retention period to more than 24 hours.
Migration scope Minimum retention Incremental data migration only More than 24 hours Full data migration + incremental data migration At least 7 days
Other limitations
DTS does not migrate online DDL operations.
DTS migrates foreign keys from the source to the destination during schema migration.
If data contains 4-byte characters (rare characters or emojis), the destination tables must use the UTF8mb4 character set. If you use schema migration, set the
character_set_serverparameter in the destination to UTF8mb4.Column names that differ only in capitalization within the same destination table may produce unexpected results because MySQL column names are case-insensitive.
If you use XA transactions in the source, DTS ensures incremental data consistency based on XA transaction continuity. If continuity is disrupted (for example, during disaster recovery), uncommitted XA transactions may be lost.
DTS temporarily disables foreign key constraint checks and cascade operations at the session level during migration. If you run cascade or delete operations on the source during this time, data inconsistency may occur.
During full data migration, concurrent INSERT operations cause table fragmentation. After migration completes, the destination tablespace size is larger than the source.
DTS retries failed tasks for up to 7 days. Before switching workloads to the destination, stop or release any failed tasks, or run REVOKE to remove DTS write permissions on the destination. Otherwise, a resumed failed task may overwrite destination data with source data.
After migration completes (task Status changes to Completed), run
ANALYZE TABLE <table_name>to verify that data was written to disk. In some high availability (HA) switchover scenarios, data may exist only in memory and can be lost.If a DTS task fails, DTS technical support attempts to restore it within 8 hours. During restoration, the task may be restarted and its parameters may be modified. Database parameters are not modified.
DTS periodically updates the
dts_health_check.ha_health_checktable in the source to advance the binary log position.
SQL operations supported for incremental migration
| Operation type | SQL statements |
|---|---|
| DML | INSERT, UPDATE, DELETE |
Permissions required for database accounts
| Database | Schema migration | Full data migration | Incremental data migration |
|---|---|---|---|
| PolarDB-X 1.0 | SELECT | SELECT | SELECT, REPLICATION SLAVE, REPLICATION CLIENT |
| ApsaraDB RDS for MySQL | Read and write permissions | Read and write permissions | Read and write permissions |
REPLICATION SLAVE and REPLICATION CLIENT are required for incremental data migration only. For instructions on granting these permissions, see Data synchronization tools for PolarDB-X.
To create accounts and grant permissions:
PolarDB-X 1.0: Manage database accounts
ApsaraDB RDS for MySQL: Create an account and Modify account permissions
Create a data migration task
The overall process has four stages:
Go to the Data Migration page and create a task.
Configure the source and destination databases, then test connectivity.
Select objects and configure migration options.
Run the precheck, purchase an instance, and start the migration.
Step 1: Go to the Data Migration page
DTS console
Log on to the DTS console.DTS console
In the left-side navigation pane, click Data Migration.
In the upper-left corner, select the region where the migration instance resides.
DMS console
Steps may vary based on the DMS console mode. See Simple mode and Customize the layout and style of the DMS console.
Log on to the DMS console.DMS console
In the top navigation bar, go to Data + AI > DTS (DTS) > Data Migration.
From the drop-down list next to Data Migration Tasks, select the region where the migration instance resides.
Step 2: Configure source and destination databases
Click Create Task.
Configure the source and destination databases using the parameters in the following table.
| Section | Parameter | Description |
|---|---|---|
| N/A | Task Name | A name for the migration task. DTS generates a name automatically. Specify a descriptive name for easy identification. The name does not need to be unique. |
| Source Database | Select Existing Connection | If the instance is already registered with DTS, select it from the list — DTS fills in the remaining parameters automatically. Otherwise, configure the parameters below. |
| Database Type | Select PolarDB-X 1.0. | |
| Access Method | Select Alibaba Cloud Instance. | |
| Instance Region | The region where the source PolarDB-X 1.0 instance resides. | |
| Replicate Data Across Alibaba Cloud Accounts | Select No if the source and destination instances are in the same Alibaba Cloud account. | |
| Instance ID | The ID of the source PolarDB-X 1.0 instance. | |
| Database Account | The database account for the source instance. See Permissions required for database accounts. | |
| Database Password | The password of the database account. | |
| Destination Database | Select Existing Connection | If the instance is already registered with DTS, select it from the list. Otherwise, configure the parameters below. |
| Database Type | Select MySQL. | |
| Access Method | Select Alibaba Cloud Instance. | |
| Instance Region | The region where the destination ApsaraDB RDS for MySQL instance resides. | |
| Replicate Data Across Alibaba Cloud Accounts | Select No if using the same Alibaba Cloud account. | |
| RDS Instance ID | The ID of the destination ApsaraDB RDS for MySQL instance. | |
| Database Account | The database account for the destination instance. See Permissions required for database accounts. | |
| Database Password | The password of the database account. | |
| Connection Method | Select Non-encrypted or SSL-encrypted. To use SSL encryption, enable it on the ApsaraDB RDS for MySQL instance first. See Use a cloud certificate to enable SSL encryption. |
Click Test Connectivity and Proceed.
Make sure that the CIDR blocks of DTS servers are added to the security settings of the source and destination databases. See Add the CIDR blocks of DTS servers.
Step 3: Select objects and configure migration options
On the Configure Objects page, set the following parameters.
| Parameter | Description |
|---|---|
| Migration Types | Select the migration types based on your needs: <br>- Schema Migration + Full Data Migration: migrates the schema and all existing data. The source can remain active during configuration, but do not write to it once migration starts. <br>- Schema Migration + Full Data Migration + Incremental Data Migration: migrates existing data and then continuously replicates changes. This keeps your application running with minimal downtime. <br><br> Note If you skip Schema Migration, create the target tables manually before starting. If you skip Incremental Data Migration, do not write to the source during migration. |
| Processing Mode of Conflicting Tables | - Precheck and Report Errors: fails the precheck if the destination has tables with the same names as the source. Use this mode to prevent accidental overwrites. To rename migrated objects, use the object name mapping feature. <br>- Ignore Errors and Proceed: skips the precheck for duplicate table names. During full data migration, existing records in the destination are retained; during incremental migration, they are overwritten. Use this mode with caution — schema differences between source and destination may cause partial migration or task failure. |
| Capitalization of Object Names in Destination Instance | Controls the case of database, table, and column names in the destination. The default is DTS default policy. See Specify the capitalization of object names for other options. |
| Source Objects | Select the objects to migrate and click the right-arrow icon to move them to Selected Objects. Selecting tables rather than an entire database is recommended. If you select an entire database, DTS does not replicate CREATE TABLE or DROP TABLE operations. |
| Selected Objects | To rename individual objects, right-click them. For bulk renaming, click Batch Edit. See Object name mapping. To filter rows, right-click an object and specify WHERE conditions. See Specify filter conditions. To select specific DML operations per object, right-click and select the operations to include. <br><br> Note Renaming an object may cause dependent objects to fail migration. |
Click Next: Advanced Settings and configure the following parameters.
| Parameter | Description |
|---|---|
| Dedicated Cluster for Task Scheduling | By default, DTS uses the shared cluster. For improved stability, purchase a dedicated cluster. See What is a DTS dedicated cluster. |
| Retry Time for Failed Connections | How long DTS retries when it cannot connect to the source or destination. Valid values: 10–1,440 minutes. Default: 720. Set this to at least 30 minutes. If multiple tasks share the same source or destination, the most recently set value applies. During retry, you are charged for the DTS instance. |
| Retry Time for Other Issues | How long DTS retries when DDL or DML operations fail. Valid values: 1–1,440 minutes. Default: 10. Set this to at least 10 minutes. This value must be less than Retry Time for Failed Connections. |
| Enable Throttling for Full Data Migration | Limits the load on the source and destination during full data migration. When enabled, configure Queries per second (QPS) to the source database, RPS of Full Data Migration, and Data migration speed for full migration (MB/s). Available only when Full Data Migration is selected. |
| Enable Throttling for Incremental Data Migration | Limits the load during incremental data migration. When enabled, configure RPS of Incremental Data Migration and Data migration speed for incremental migration (MB/s). Available only when Incremental Data Migration is selected. |
| Environment Tag | An optional tag to identify the DTS instance by environment (for example, production or test). |
| Configure ETL | Whether to apply extract, transform, and load (ETL) transformations. Select Yesalert notification settings to enter data processing statements. See Configure ETL in a data migration task. |
| Monitoring and Alerting | Whether to configure alerts for task failure or high migration latency. Select Yes and configure the threshold and notification settings. See Configure monitoring and alerting. |
Step 4: Run the precheck and start migration
Click Next: Save Task Settings and Precheck.
To view the API parameters for this configuration, hover over Next: Save Task Settings and Precheck and click Preview OpenAPI parameters before proceeding.
DTS runs a precheck automatically. If any items fail:
Click View Details next to the failed item, resolve the issue, and click Precheck Again.
If an item shows an alert that can be ignored, click Confirm Alert Details > Ignore > OK, then click Precheck Again. Ignoring alerts may cause data inconsistency.
Wait until Success Rate reaches 100%, then click Next: Purchase Instance.
On the Purchase Instance page, configure the following parameters.
| Section | Parameter | Description |
|---|---|---|
| New Instance Class | Resource Group | The resource group for the migration instance. Default: default resource group. See What is Resource Management? |
| Instance Class | The instance class determines migration speed. See Instance classes of data migration instances. |
Read and select Data Transmission Service (Pay-as-you-go) Service Terms, then click Buy and Start > OK.
Verify the migration
Monitor progress on the Data Migration page.
Full data migration only: the task stops automatically when complete. The Status column shows Completed.
Incremental data migration: the task runs continuously and does not stop automatically. The Status column shows Running.
After the task status changes to Completed, run the following command to verify that data was written to the destination tables:
ANALYZE TABLE <table_name>;Before switching application traffic to the destination database, stop or release any failed migration tasks, or revoke DTS write permissions using REVOKE. This prevents a resumed task from overwriting your migrated data.