PolarDB-X assessment and migration tool

Updated at:

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.

  1. Create a migration task: Configure the source and destination instance information to establish the migration's foundation.

  2. Precheck and repair: The system automatically checks the environment, permissions, and configurations and provides guidance for repairs.

  3. Schema migration: Migrate table and view structures from the source instance and configure data sharding rules for the distributed environment.

  4. Data migration and monitoring: Perform a full data migration and incremental data synchronization while monitoring the migration status in real time.

  5. Service switchover: When the data synchronization latency is very low, switch the service traffic to the new PolarDB-X 2.0 Enterprise Edition instance.

  6. (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-20240412 or later.

      Note
      • 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.

  1. Go to the PolarDB-X console. In the upper-left corner, select the region where your destination instance resides.

  2. You can use either of the following methods to open the Create Migration Task page:

    1. In the navigation pane on the left, click Instances, switch to the PolarDB-X 2.0 tab, and click Migration Evaluation.

    2. In the navigation pane on the left, choose Migration Evaluation and then click Create Migration Task.

  3. 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.

  4. 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

  • Cause: Network connectivity issues, or incorrect username, password, or permissions for the source or destination instance.

  • Repair: Verify the following:

    • The source and destination instances are running normally.

    • The entered username and password are correct.

    • The account has necessary read, write, and replication permissions.

BINLOG_CONFIG

  • Cause: The source instance’s Binlog configuration does not meet incremental sync requirements.

  • Repair: Log on to the source instance and enable Binlog.

    • For RDS for MySQL or a PolarDB-X 1.0 instance that uses RDS for MySQL as storage, set the binlog_row_image parameter to FULL.

    • For PolarDB for MySQL, enable Binlog in the console.

TABLE_META

  • Cause: Tables without a primary key or non-null unique key exist in databases to be migrated.

  • Repair: To support incremental sync and data validation, add a primary key or non-null unique key to all tables being migrated.

CONFLICT

  • Cause: A table with the same name already exists in the destination database.

  • Repair: Rename or delete the conflicting table in the destination instance. For data safety, the migration tool does not overwrite existing data.

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.

  1. On the Schema Migration page, all tables to be migrated are listed. You can select all objects or choose specific tables.

  2. 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_id or order_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_id for user tables, or order_id or buyer_id for order tables.

    Note
  3. 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.

  1. When the schema migration is complete, click Start Migration.

  2. 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.

  3. In the Actions column for the task, click Actions > Details 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.

      Note

      Incremental 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.

  • Relies on DNS cache refresh, causing brief delay (typically 30 seconds to 5 minutes)

  • Requires specific network conditions.

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

  1. Go to the Migration Evaluation list. Click the task’s Actions > Details button to open the Task Details page.

  2. On the Switchover details page, you can click Start forward switchover.

  3. In the dialog box, select Switch with Endpoints (Connection Changes Not Required) and then click OK.

  4. 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.

  5. 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 processlist command 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

  1. Go to the Migration Evaluation list. Click the task’s Actions > Details button to open the Task Details page.

  2. On the Switchover details page, click Start forward switchover.

  3. In the dialog box, select Switch without Endpoints (Connection Changes Required) and click OK.

  4. The system immediately disables write operations on the source instance for 24 hours.

  5. Manually perform the switchover and confirm the result:

    1. 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.

    2. Use the show processlist command or other monitoring tools to confirm that no active connections remain on the source instance.

    3. 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.

Important

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.

  1. Go to the Migration Evaluation list. Click the task’s Actions > Details button to open the Task Details page.

  2. On the Switchover details page, click Enable reverse rollback, and then click OK.

  3. The system immediately disables write operations on the destination PolarDB-X 2.0 Enterprise Edition instance for 24 hours.

  4. 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.

        Note

        The 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.

  5. 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.

    Note

    You can use the SHOW PROCESSLIST command to check the client IP addresses and confirm whether any business connections remain.

Billing

The assessment and migration feature is free of charge.

FAQ

After an address switch, why can't my application connect to the new database?

This issue is usually caused by a stale DNS cache on application servers. You can try the following solutions:

  • Wait for an automatic refresh: The DNS cache typically expires within 30 seconds to 5 minutes.

  • Manually flush the DNS: You can flush the DNS based on your server’s operating system and version. For example, on Alibaba Cloud Linux 2/3, you can use the following commands:

    1. First, check if systemd-resolved is running. A status of Active: active (running) indicates that the service is active.

      sudo systemctl status systemd-resolved
    2. Flush the systemd-resolved DNS cache.

      sudo systemd-resolve --flush-caches
  • Check the application configuration: Java applications, for example, cache DNS results indefinitely by default. You may need to restart the application or set a shorter DNS cache timeout in the JVM startup parameters.