Overview
This topic describes how to use the one-click migration feature to migrate data from an ApsaraDB RDS for MySQL instance to a PolarDB-X 2.0 Standard Edition instance, including its prerequisites, limitations, and billing.
Migration
You can migrate an RDS MySQL instance to PolarDB-X 2.0 Standard Edition with a single click. This process automatically creates a destination PolarDB-X 2.0 Standard Edition instance and synchronizes data. The migrated PolarDB-X 2.0 Standard Edition instance includes the account information, databases, IP address whitelist, and necessary parameters from the source RDS instance.
One-click migration from ApsaraDB RDS for MySQL to PolarDB-X 2.0 Standard Edition uses logical migration, powered by Data Transmission Service (DTS).
Logical migration (via DTS): This method uses Data Transmission Service (DTS) to create a data synchronization task. The task synchronizes the database schema, table structures, and full data from the source ApsaraDB RDS for MySQL instance to the new PolarDB-X 2.0 Standard Edition instance, and then maintains incremental data synchronization.
The following table lists the supported source ApsaraDB RDS for MySQL versions and storage types.
Version | Basic Edition | High-availability Edition | Cluster Edition | Enterprise Edition |
5.6 | N/A | local SSD | N/A | local SSD |
5.7 | cloud disk | local SSD and cloud disk | cloud disk | local SSD |
8.0 | cloud disk | local SSD and cloud disk | cloud disk | local SSD |
Benefits
The one-click migration feature provides the following benefits:
You can keep your original database endpoint, which allows your applications to switch to the new PolarDB-X 2.0 Standard Edition instance without any configuration changes.
The migration process is free of charge.
Zero data loss occurs during migration.
Incremental migration is supported, with less than 10 minutes of service downtime.
Hot migration is supported. The process involves only a single transient interruption when your service cuts over from the ApsaraDB RDS for MySQL instance to the PolarDB-X 2.0 Standard Edition instance.
Rollback is supported. If a migration fails, you can restore the original state within 10 minutes.
PolarDB-X 2.0 Standard Edition and ApsaraDB RDS for MySQL Enterprise Edition are highly compatible.
Prerequisites
The one-click migration feature is available only for source ApsaraDB RDS for MySQL instances that use the InnoDB or X-Engine storage engine for tables.
Because the one-click migration is a logical migration performed by Data Transmission Service (DTS), if the source RDS for MySQL has triggers, you must first delete the triggers on the RDS for MySQL and then click Continue Migration, or click Cancel Migration to manually create a migration task in the DTS console. For more information, see How to configure a synchronization or migration task when triggers exist in the source database.
If the ApsaraDB RDS for MySQL instance is in Database Proxy mode, you must create a privileged account (see Create an account) or switch to High-Performance mode (see [Product/Feature Changes] RDS network link upgrade notice) to perform the one-click migration.
To check if your instance uses Database Proxy, go to the instance console, click Database Connection in the left-side navigation pane, and verify that the Database Proxy (formerly High-Security Mode) status is Enabled.
Limitations
You can migrate data from an ApsaraDB RDS for MySQL instance only to a PolarDB-X 2.0 Standard Edition instance of the same or a later version. Downgrading the version is not supported.
Switchover with endpoints does not support IPv6 addresses.
Logical migration that uses DTS has the following limitations:
Cross-region migration is not supported.
You cannot modify the parameters of the source ApsaraDB RDS for MySQL instance during the migration.
You can migrate only five types of objects: databases, tables, views, stored procedures, and functions.
The source database has the following limitations:
Type
Description
Source database limitations
Tables that you synchronize must have a primary key or a unique constraint, and the fields in the constraint must be unique. Otherwise, data duplication may occur in the target database.
If you synchronize data at the table level and need to edit objects, such as by mapping column names, a single task can synchronize a maximum of 1,000 tables. If you exceed this limit, the task submission fails. In this case, split the tables into multiple tasks or configure a task to synchronize the entire database.
Binary log:
You must enable the binary log, and the
binlog_row_imageparameter must be set tofull. Otherwise, a precheck error occurs, and the data synchronization task cannot start. For more information, see Modify instance parameters.For incremental synchronization tasks, you must retain the binary log of the source database for at least 24 hours. For tasks that include both full and incremental synchronization, the binary log must be retained for at least 7 days. You can change the retention period back to 24 hours after the full synchronization is complete. If DTS cannot obtain the binary log, the task may fail, and in extreme cases, data may be inconsistent or lost. The DTS Service Level Agreement (SLA) does not cover issues caused by a binary log retention period that is shorter than required. If the source is an ApsaraDB RDS for MySQL instance, see Manage binary logs for instructions.
SQL statement limitations:
Operation type
SQL statement
DML
INSERT, UPDATE, DELETE
DDL
ALTER TABLE, ALTER VIEW
CREATE FUNCTION, CREATE INDEX, CREATE PROCEDURE, CREATE TABLE, CREATE VIEW
DROP INDEX, DROP TABLE
RENAME TABLE
TRUNCATE TABLE
Other limitations:
Type
Description
Other limitations
Before you start, evaluate the performance of the source and target databases. We recommend that you run the data synchronization task during off-peak hours. The initial full data synchronization consumes read and write resources on both databases, which can increase the database load.
Full data synchronization involves concurrent INSERT operations, which can cause table fragmentation in the target database. As a result, the target instance uses more table space than the source instance after the full synchronization is complete.
During DTS synchronization, do not write data to the target database from sources other than DTS. This can cause data inconsistency between the source and target databases. For example, if you use Data Management (DMS) to perform online DDL changes while other writes occur on the target database, data loss may occur.
By default, DTS disables foreign key constraints on the target database during synchronization. Therefore, DTS does not replicate operations such as cascading deletes in the source database to the target database.
Usage notes
The SSL encryption status must match on corresponding source ApsaraDB RDS for MySQL and target PolarDB-X 2.0 Standard Edition endpoints:
If SSL is enabled for the endpoint of the source ApsaraDB RDS for MySQL instance and you choose to use switchover with endpoints for that endpoint, ensure that SSL is also enabled for the corresponding endpoint of the target PolarDB-X 2.0 Standard Edition instance.
If SSL is disabled for the endpoint of the source ApsaraDB RDS for MySQL instance, ensure that SSL is also disabled for the corresponding endpoint of the target PolarDB-X 2.0 Standard Edition instance.
Billing
The one-click migration process is free of charge. DTS transfer and synchronization tasks are free. You pay only for the resources of the target PolarDB-X 2.0 Standard Edition instance.
Backup policy
The target PolarDB-X 2.0 Standard Edition instance inherits the backup cycle and start time from the source ApsaraDB RDS for MySQL instance.
After the migration is complete, you can configure the backup policy in the console based on your business requirements.
Switchover with endpoints
When you perform a one-click migration from RDS MySQL to PolarDB-X 2.0 Standard Edition with endpoint switchover, the system automatically swaps the connection endpoints of RDS MySQL and PolarDB-X 2.0 Standard Edition, which allows you to automatically connect to PolarDB-X 2.0 Standard Edition without modifying any configurations in your application. If you select this switchover method, the following figure shows the mapping of the RDS MySQL connection endpoint to the corresponding PolarDB-X 2.0 Standard Edition connection endpoint.
When you use the switchover with endpoints feature, take note of the following:
A switchover with endpoints only switches the domain names of RDS MySQL and PolarDB-X 2.0 Standard Edition. Configurations such as VSwitches and VIPs are not switched.
The switchover applies only to endpoints that exist on both the source ApsaraDB RDS for MySQL and target PolarDB-X 2.0 Standard Edition instances. By default, only the primary internal endpoint (VPC) supports switchover with endpoints.
IPv6 addresses are not supported for switchover with endpoints.
A switchover with endpoints does not change the port. Ensure that the connection ports for RDS MySQL and PolarDB-X 2.0 Standard Edition are the same (the default port number for both RDS MySQL and PolarDB-X 2.0 Standard Edition is 3306). If you need to modify the port, see View and manage instance endpoints and ports.
After the switchover, you may experience connection issues or find that the database is read-only due to DNS caching. These issues may persist until the DNS cache on your server expires. Flush your server's DNS cache to resolve this.
After the switchover, if you need to log on to the PolarDB-X 2.0 Standard Edition instance by using DMS, you must use the latest version of DMS and log on with the instance ID of the PolarDB-X 2.0 Standard Edition instance. You cannot log on by using the connection string.