Migrate data from ApsaraDB RDS to PolarDB-X 1.0
This topic describes how to use the Import Evaluation feature of PolarDB-X 1.0 to migrate data from an ApsaraDB RDS instance to a PolarDB-X 1.0 instance.
Background
As your business grows, increasing data volumes, storage usage, concurrency, and queries per second (QPS) can cause performance bottlenecks on your ApsaraDB RDS instance. To address these challenges, you can migrate to PolarDB-X 1.0 to leverage database and table sharding. When migrating data from ApsaraDB RDS to PolarDB-X 1.0, consider the following questions:
-
What PolarDB-X 1.0 instance type should you choose?
-
What instance type should you choose for the underlying ApsaraDB RDS instances used by PolarDB-X 1.0?
-
After a table is migrated from ApsaraDB RDS to PolarDB-X 1.0, how do you shard it? How do you choose the number of shards and the shard key?
-
How can you quickly create the required databases and tables?
-
How can you quickly import data from ApsaraDB RDS to PolarDB-X 1.0?
Solution
To address these questions, PolarDB-X 1.0 provides the Import Evaluation feature, which helps you quickly migrate data from ApsaraDB RDS to a PolarDB-X 1.0 instance.
Table 1. Migration process
|
Step |
Description |
|
The evaluation suggestions feature of PolarDB-X 1.0 can:
|
|
|
The PolarDB-X 1.0 data import feature supports the following methods:
|
|
|
After the full data synchronization task is complete, PolarDB-X 1.0 provides incremental data synchronization for 14 days. After all data is imported, you can switch your business applications from ApsaraDB RDS to PolarDB-X 1.0. |
Step 1: Obtain evaluation suggestions
PolarDB-X 1.0 can evaluate your source ApsaraDB RDS database and provide suggestions for migrating to the destination PolarDB-X 1.0 instance. The evaluation report contains all suggestions.
-
Log on to the PolarDB-X 1.0 console.
-
In the top navigation bar, select the region where the instance is deployed.
-
In the navigation pane, choose .
-
In the upper-right corner of the Suggestions page, click Start ApsaraDB RDS Evaluation.
-
On the Source Database Information page, set the following parameters.
Parameter
Description
Task name
Enter a name for the migration task.
Source Database Information
Instance type
This parameter is fixed to ApsaraDB RDS Instance and cannot be changed.
ApsaraDB RDS Instance ID
Select the source ApsaraDB RDS instance.
Database name
Select the source database.
Database port
Enter the port of the source database.
Database Account
Enter the account for the source database.
Database Password
Enter the password for the source database account.
NoteAfter you enter the password, you can click Test Connection to verify connectivity to the source ApsaraDB RDS instance.
Business Information
For more accurate evaluation suggestions, set Expected Data Size Growth in Percentage and Expected Average QPS Growth in Percentage based on your business needs.
Evaluation Duration
You can set the evaluation duration to 1 hour, 3 hours, 6 hours, 1 day, 3 days, or 7 days. You can also specify a custom duration from 1 to 336 hours (14 days).
-
Select Agree to Enable SQL Explorer and click Next.
-
On the Task Precheck page, wait until the Precheck Result is Successful, and then click Start Task.
-
After the evaluation task is complete, you can perform the following actions:
-
In the Actions column for the task, click Evaluation Report to view the evaluation suggestions.
NoteIn the Recommended Sharding Result section, click Show to view sharding details, such as the sharding type and shard key. You can also click Export Table Creation SQL Statement to download the table creation SQL statements.
-
In the Actions column for the task, click Start Import to begin the data import.
-
Step 2: Import data
You can import data from the source ApsaraDB RDS instance to the destination PolarDB-X 1.0 instance in one of the following ways:
-
Import based on evaluation suggestions
-
Log on to the PolarDB-X 1.0 console.
-
In the upper-left corner, select the destination instance's region.
-
In the navigation pane, choose .
-
Find the target task and click Start Import in the Actions column.
-
On the Evaluation Summary page, confirm the recommended instance specifications and quantities, and then click Next.
-
Select the destination PolarDB-X 1.0 instance, click the
icon to move it to the selected list, and then click Next.NoteYou can select only one PolarDB-X 1.0 instance.
-
Select the destination instances, click the
icon to move them to the selected list, and then click Next.NoteYou can use existing ApsaraDB RDS instances. However, we recommend purchasing new ApsaraDB RDS instances to ensure dedicated storage resources for the destination PolarDB-X 1.0 instance.
-
On the Task Precheck page, wait until the Precheck Result is Successful, and then click Next.
-
On the Confirm Topology page, verify the source ApsaraDB RDS instance, source database, and destination PolarDB-X 1.0 instance, and then click Create Task.
-
-
Custom import
-
Log on to the PolarDB-X 1.0 console.
-
In the upper-left corner, select the destination instance's region.
-
In the navigation pane, choose .
-
In the upper-right corner of the Import Task page, click ApsaraDB RDS Custom Import.
-
On the Source and Destination Databases page, set the following parameters, and then click Next.
Parameter
Description
Task name
Enter a name for the migration task.
Source Database Information
Instance type
This parameter is fixed to ApsaraDB RDS Instance and cannot be changed.
ApsaraDB RDS Instance ID
Select the source ApsaraDB RDS instance.
Database name
Select the source database.
Database port
Enter the port of the source database.
Database account
Enter the account for the source database.
Database Password
Enter the password for the source database account.
NoteAfter you enter the password, you can click Test Connection to verify connectivity to the source ApsaraDB RDS instance.
Destination Database Information
Database port
Enter the port of the destination database.
Database account
Enter the account for the destination database.
Database Password
Enter the password for the destination database account.
NoteAfter you enter the password, you can click Test Connection to verify connectivity to the destination PolarDB-X 1.0 instance.
-
On the Migration Task page, select the tables to migrate from the Source Table Name list on the left. For each source table, select its corresponding destination table from the Destination Table Name list on the right. Then, click Next.
ImportantYou cannot migrate tables that use a composite primary key. If you try to migrate such a table, the Task Precheck fails.
-
On the Task Precheck page, wait until the Precheck Result is Successful, and then click Start Task.
-
Step 3: Complete the migration
-
Log on to the PolarDB-X 1.0 console.
-
In the top navigation bar, select the region where the instance is deployed.
-
In the navigation pane, choose .
-
Find the target task and click End Task in the Actions column.
Note-
PolarDB-X 1.0 provides an incremental data synchronization service for 14 days after a full data synchronization task is complete. After the Task Progress reaches 100%, you can click End Task to manually complete the migration. You can also wait for the system to automatically End Task after the 14-day incremental data synchronization service stops.
-
After you click End Task, the data import task's Task Status changes from Running to Completed. You can then click Clear Task to remove it from the task list.
-
FAQ
Q: Do I need to stop write operations on the source database before starting the data import?
No, you do not need to. PolarDB-X 1.0 guarantees 14 days of incremental data synchronization after the full data synchronization task is complete. After the Task Progress shows 100%, you can click End Task to manually complete the migration. Alternatively, you can wait for the system to automatically End Task after the 14-day incremental data synchronization service stops.

