PolarDB-X assessment and migration tool
If business growth creates data scalability challenges or you plan to upgrade an existing RDS for MySQL or PolarDB for MySQL database to a distributed architecture for horizontal scaling, you can use the assessment and migration tool provided by PolarDB-X. This visual, wizard-driven migration service moves your data to PolarDB-X 2.0 Enterprise Edition. The tool covers the entire migration lifecycle, from historical data migration and real-time incremental synchronization to service traffic switchover.
Overview
Core migration workflow
The migration process consists of six main stages that follow a prepare-execute-validate-switch logic to ensure clarity and control.
-
Create a migration task: Configure the source and destination instance information to establish the migration's foundation.
-
Precheck and repair: The system automatically checks the environment, permissions, and configurations and provides guidance for repairs.
-
Schema migration: Migrate table and view structures from the source instance and configure data sharding rules for the distributed environment.
-
Data migration and monitoring: Perform a full data migration and incremental data synchronization while monitoring the migration status in real time.
-
Service switchover: When the data synchronization latency is very low, switch the service traffic to the new PolarDB-X 2.0 Enterprise Edition instance.
-
(Optional) Service rollback: If unexpected issues occur after the switchover, you can use the reverse sync link to safely roll back services to the source instance.
Supported migration scenarios
-
Upgrade from PolarDB-X 1.0 or PolarDB-X 2.0 Standard Edition to PolarDB-X 2.0 Enterprise Edition.
-
Migrate from RDS for MySQL or PolarDB for MySQL to PolarDB-X 2.0 Enterprise Edition for a distributed transformation.
-
Perform a major engine version upgrade, for example, from 5.7 to 8.0, or a cross-instance data migration on PolarDB-X 2.0 Enterprise Edition.
|
Data source |
Destination |
Full migration |
Incremental DML |
Data validation |
Data correction |
Address switching |
Reverse sync |
|
PolarDB-X 1.0 |
PolarDB-X 2.0 Enterprise Edition |
Support |
Support |
Support |
Support |
Support |
Support |
|
RDS for MySQL |
PolarDB-X 2.0 Enterprise Edition |
Support |
Support |
Supported |
Support |
Support |
Support |
|
PolarDB for MySQL |
PolarDB-X 2.0 Enterprise Edition |
Support |
Support |
Support |
Support |
Support |
Support |
|
PolarDB-X 2.0 Standard Edition |
PolarDB-X 2.0 Enterprise Edition |
Support |
Support |
Support |
Support |
Support |
Support |
|
PolarDB-X 2.0 Enterprise Edition |
PolarDB-X 2.0 Enterprise Edition |
Supported |
Support |
Support |
Support |
Support |
Supported |
Applicability
Before you use the assessment and migration tool, confirm that your migration scenario meets the following conditions.
-
Region restrictions: The tool is supported only in the Chinese mainland and China (Hong Kong) regions.
-
Destination instance restrictions:
-
The destination instance must be a PolarDB-X 2.0 Enterprise Edition instance.
-
If you are migrating to an AUTO-mode database, the destination version must be
polardb-2.3.0_5.4.18-17142802_xcluster5.4.18-20240412or later.NoteInstance version naming rules, see Version notes.
Instance version viewing method, see View the instance version.
-
Because of the architectural differences between AUTO-mode and DRDS-mode databases, you must perform service and performance tests before the switchover.
-
-
Source instance restrictions:
-
Binary logging requirements: The source instance must have binary logging enabled. For example, if the source instance is a PolarDB for MySQL cluster or a PolarDB-X 1.0 instance that uses PolarDB for MySQL for storage, you must enable binary logging for the PolarDB for MySQL cluster in advance.
-
PolarDB-X 1.0 special restriction: If the source instance is PolarDB-X 1.0 and you plan to use address switching, all databases under the instance must be migrated in the same migration task.
-
Important notes
-
Object and structure limitations:
-
Migration objects: Only tables and views can be migrated. You must manually configure instance-level configurations, such as database accounts and backup policies, after the migration.
-
Migration granularity: You can select multiple databases at once and specify only certain tables within those databases.
-
Primary key requirement: Tables that you want to migrate must have a primary key or a non-null unique key. Otherwise, the precheck fails.
-
Naming conflicts: The destination instance must not contain tables with the same names as the tables being migrated from the source.
-
-
Performance impact assessment:
-
Data migration consumes read and write resources on both the source and destination instances, which increases the CPU and IOPS load. We recommend that you run migrations during off-peak hours and ensure that the instances have sufficient capacity.
-
To prevent performance interference, avoid migrating data to an existing PolarDB-X 2.0 Enterprise Edition instance that already handles live traffic.
-
-
Operational risks and contingency plans:
-
Storage node count differences: A difference in the number of storage nodes between the source and destination instances does not affect the migration. PolarDB-X 2.0 Enterprise Edition automatically rebalances data distribution.
-
Prohibited operations: From the time the task is created until the switchover is complete, do not perform scale-out, scale-in, hot table migration, shard key changes, or any Data Definition Language (DDL) operations, such as altering table schemas, on the source or destination instances. These actions may cause migration failure, data inconsistency, or operation errors.
-
Switchover Risks: A service switchover is a core operation. Before you perform the switchover, you must carefully read the instructions in the Step 5: Service Switchover section, especially the limitations on source instance write protection, DNS cache purge, and rollback.
-
-
Permissions and security:
-
Account permissions:
-
Source database account: The account must have Binlog replication and read permissions on the source databases.
-
Destination instance account: The account must have read and write permissions on the target databases.
-
-
Whitelist:
-
If the source instance is RDS for MySQL, PolarDB for MySQL, or PolarDB-X 2.0, the migration tool automatically copies the IP whitelist to the destination PolarDB-X 2.0 Enterprise Edition instance. No manual configuration is required.
-
If the source instance is PolarDB-X 1.0, you must manually configure the IP whitelist for the destination PolarDB-X 2.0 Enterprise Edition instance after the migration.
-
-
Create and run a migration task
Follow these steps to migrate your database to a PolarDB-X 2.0 Enterprise Edition instance.
Step one: Create a migration task
Configure the source and destination information to start the migration process.
-
Go to the PolarDB-X console. In the upper-left corner, select the region where your destination instance resides.
-
You can use either of the following methods to open the Create Migration Task page:
-
In the navigation pane on the left, click Instances, switch to the PolarDB-X 2.0 tab, and click Migration Evaluation.
-
In the navigation pane on the left, choose Migration Evaluation and then click Create Migration Task.
-
-
On the Create Migration Task page, configure the following settings:
-
Task Name: Enter a descriptive name for the task.
-
Source database: Select the source database type, such as RDS for MySQL or PolarDB for MySQL, region, specific instance, and databases to migrate. Provide the username and password of an account that has the required permissions.
-
Destination database: Select your destination PolarDB-X 2.0 Enterprise Edition instance, specify the destination database, and provide the username and password of an account that has read and write permissions.
-
-
Click Next to begin the precheck stage.
Step two: Precheck and repair
The system automatically verifies that the environment, permissions, and configurations meet the requirements for migration. It provides clear repair instructions for any failed checks. If all checks pass, proceed to the next stage. If any check fails, follow the repair guide and click Retry.
|
Check item |
Failure analysis and repair guide |
|
CONNECTIVITY |
|
|
BINLOG_CONFIG |
|
|
TABLE_META |
|
|
CONFLICT |
|
Step three: Schema migration
Migrate the table and view structures from the source instance to the destination PolarDB-X 2.0 Enterprise Edition instance and configure the core sharding rules for the distributed environment.
-
On the Schema Migration page, all tables to be migrated are listed. You can select all objects or choose specific tables.
-
Configure sharding rules: For a table that requires sharding, click Adjust Table Structure next to the table to define its sharding rule.
-
Sharding rule definition: PolarDB-X is a distributed database that stores data across multiple nodes. A sharding rule defines how data is split and distributed. Typically, you can select a column, such as
user_idororder_id, as the shard key. PolarDB-X uses the value of this key, for example, using a HASH algorithm, to determine which physical shard stores each row. -
Shard key selection: Choose a column that is frequently used as a filter condition in queries as the shard key to improve query performance. For example, you can use
user_idfor user tables, ororder_idorbuyer_idfor order tables.
Note-
To ensure a successful data migration, do not modify column names or data types unless absolutely necessary..
-
For more information about PolarDB-X partitioned tables and SQL syntax, see User Guide – Partitioned tables and Developer Guide – Data tables.
-
-
After you confirm the settings, click Start Schema Migration. This action creates the corresponding table structures in the destination instance.
Step four: Data migration and monitoring
Copy the full data and synchronize incremental changes while you monitor the migration progress and latency in real time.
-
When the schema migration is complete, click Start Migration.
-
After the migration starts, return to the Migration Evaluation list. The task status changes to Preparing and then to Migrating after the resources are ready.
-
In the Actions column for the task, click to open the Task Details page. On the Data migration details page, you can view the detailed progress. The migration occurs in three automatic sub-stages:
-
Full migration: Copies all the historical data from the source objects to the destination instance.
-
Incremental migration: Starts automatically after the full migration is complete. This sub-stage continuously synchronizes new data changes, such as inserts, deletes, and updates, from the source to the destination to maintain dynamic consistency.
NoteIncremental migration runs continuously and does not stop until you switch your services to the destination instance.
-
Data validation: When the latency of incremental migration drops below 30 seconds, the system automatically starts data validation. This sub-stage compares the rows between the source and destination to ensure complete consistency.
-
Determine switchover timing: You can perform a switchover when the validation progress reaches 100% with no inconsistencies and the incremental migration latency stabilizes at less than 20 seconds. For best results, monitor the latency for five consecutive minutes to confirm that it remains below 5 seconds before performing the switchover.
Step five: Service switchover
After you ensure data synchronization, switch the application traffic from the source database to the destination PolarDB-X 2.0 Enterprise Edition instance. The switchover is a critical step. Read this section before you proceed.
Choose a switchover method
The assessment and migration tool provides two switchover methods. You can choose a method as needed.
|
Switchover method |
Advantages |
Disadvantages |
Use case |
|
With address switching |
Applications require no connection configuration changes—transparent to apps. |
|
Scenarios where you cannot or prefer not to modify application code or configuration. |
|
Without address switching |
More controllable process—no DNS dependency. |
Requires manually updating database connection strings in all application services. |
Scenarios where you can control application configuration deployment. |
Write operation restrictions
To ensure data consistency, the system automatically prohibits write operations on the source instance, or requires you to manually prohibit write operations on the source instance during the switchover.
-
For PolarDB-X 1.0 source instances (versions earlier than 5.3.8-15489913): Before you click Start forward switchover, you must manually stop all application writes to the source instance and maintain this state until the switchover is complete.
-
Source instance is PolarDB-X 1.0 (version 5.3.8-15489913 or later): After you click Start forward switchover, the system automatically disables writes to the source instance for 24 hours. If you choose without address switching, you must update all application connection addresses within 24 hours. If you miss this 24-hour window, you must manually revoke write permissions to ensure that the source instance remains write-disabled until the switchover is complete.
-
If the source instance is RDS for MySQL, PolarDB for MySQL, or PolarDB-X 2.0, clicking Start forward switchover automatically disables writes to the source instance until you complete the switchover or initiate a rollback.
With address switching
This method swaps the connection addresses between the source and destination instances. This enables automatic application redirection without requiring you to modify application configurations.
Additional restrictions
-
Port requirement: The source and destination instances must use the same port number.
-
Source instance restriction: If the source instance is a PolarDB-X 1.0 instance, all of its databases must be migrated in the same task.
-
Switch address range:
-
By default, only the private and public primary endpoints are swapped. The read-only endpoints remain unchanged. If your application uses read-only instances, you must handle them separately.
-
If the source instance is a PolarDB for MySQL instance, only cluster endpoints can be swapped.
-
-
Manual configuration items: The switchover changes only the connection addresses, not the instance names. Services that rely on instance names, such as DMS, DTS, or DataWorks, require manual reconfiguration.
-
DNS cache propagation time: After the address swap, applications can connect to the new database only after the DNS cache on the client expires. This process typically takes 30 seconds to 5 minutes. To speed up the propagation, you can log on to your application servers and manually flush the DNS cache.
Procedure
-
Go to the Migration Evaluation list. Click the task’s button to open the Task Details page.
-
On the Switchover details page, you can click Start forward switchover.
-
In the dialog box, select Switch with Endpoints (Connection Changes Not Required) and then click OK.
-
The system automatically executes the following:
-
Disable writes to source: Immediately blocks all write operations on the source instance for 24 hours.
-
Wait for synchronization: Waits until all incremental data is fully synchronized to the destination instance.
-
Swap addresses: Replaces the endpoint of the destination PolarDB-X 2.0 Enterprise Edition instance with the original address of the source instance. This process takes about 2 minutes.
-
-
Authentication and Confirmation:
-
Wait for the DNS cache on the application server to expire. This typically takes 30 seconds to 5 minutes. You can also manually flush the cache. After the cache expires, the applications automatically connect to the new PolarDB-X 2.0 Enterprise Edition instance.
-
Use the
show processlistcommand or other monitoring tools to confirm that no active connections remain on the source instance. -
After you confirm the result, click Confirm no business connections to source. The system removes the write prohibition on the source instance and establishes a reverse synchronization link for a potential rollback.
-
Without address switching
This method requires you to manually update your application’s database connection configuration.
Recommendation
To prevent a partial application misconfiguration from causing dual writes (simultaneous writes to both the source and destination instances), which can lead to severe data inconsistency, we strongly recommend that you revoke the application write permissions on the source instance using account permission management before you change the connection addresses.
Procedure
-
Go to the Migration Evaluation list. Click the task’s button to open the Task Details page.
-
On the Switchover details page, click Start forward switchover.
-
In the dialog box, select Switch without Endpoints (Connection Changes Required) and click OK.
-
The system immediately disables write operations on the source instance for 24 hours.
-
Manually perform the switchover and confirm the result:
-
When the page displays Ready to manually update application connection strings, change all application database endpoints to the address of the destination PolarDB-X 2.0 Enterprise Edition instance, then restart or reload your applications.
-
Use the
show processlistcommand or other monitoring tools to confirm that no active connections remain on the source instance. -
After confirmation, click Confirm no business connections to source. This establishes a reverse sync link for rollback.
-
Step six: (Optional) Service rollback
If serious issues, such as unexpected performance degradation or functional errors, arise after you switch to the PolarDB-X 2.0 Enterprise Edition instance, you can roll back the services to the source database.
Rollback is a one-way operation that permanently aborts the current migration task. This is a high-risk action. Proceed with caution. To migrate the data again after a rollback, you must delete the current task and create a new one.
-
Go to the Migration Evaluation list. Click the task’s button to open the Task Details page.
-
On the Switchover details page, click Enable reverse rollback, and then click OK.
-
The system immediately disables write operations on the destination PolarDB-X 2.0 Enterprise Edition instance for 24 hours.
-
Complete the following steps based on the switchover method that you used:
-
If you select Switch with Endpoints (Connection Changes Not Required):
-
After data consistency is confirmed, the system automatically swaps the endpoints of the PolarDB-X 2.0 Enterprise Edition instance and the source instance. This process takes about 2 minutes.
-
After the endpoints are updated, the applications automatically reconnect to the source instance after the DNS cache expires. No configuration changes are needed.
NoteThe propagation time depends on the DNS cache expiration, which is typically 30 seconds to 5 minutes. You can manually flush the DNS cache on the application servers to accelerate the process.
-
-
If you selected Switch without Endpoints (Connection Changes Required):
-
After data consistency is confirmed, the console displays Ready to manually update application connection strings to source. You can now update your application connection strings to point to the source instance.
-
-
-
Confirm rollback: Monitor the destination instance to verify that all traffic has returned to the source. Then, click Confirm no business connections to destination. This action removes write protection from the destination instance, pauses both the forward and reverse sync links, and ends the migration task.
NoteYou can use the
SHOW PROCESSLISTcommand to check the client IP addresses and confirm whether any business connections remain.
Billing
The assessment and migration feature is free of charge.