Migrate data from an ApsaraDB RDS instance to a PolarDB-X 1.0 instance

Updated at: 2025-01-24 07:18

This topic describes how to use the evaluation and import feature of PolarDB-X 1.0 to migrate data from an ApsaraDB RDS instance to a PolarDB-X 1.0 instance.

Issues to consider

As business growth drives the expansion of data volumes and the increase in storage usage, concurrent activities, and queries per second (QPS) on an ApsaraDB RDS instance, the instance may experience performance bottlenecks. In this case, you can migrate data from the ApsaraDB RDS instance to a PolarDB-X 1.0 instance to leverage database and table sharding for improved performance and scalability. To migrate data from an ApsaraDB RDS instance to a PolarDB-X 1.0 instance, you may need to consider the following issues:

  • How do you select the PolarDB-X 1.0 instance type?

  • How do you select the specifications of the ApsaraDB RDS instance whose data is imported to the PolarDB-X 1.0 instance?

  • How do you shard a regular table that is migrated from the ApsaraDB RDS instance to the PolarDB-X 1.0 instance? How do you determine the number of shards and the shard keys?

  • How do you quickly create databases and tables?

  • How do you quickly import data from the ApsaraDB RDS instance to the PolarDB-X 1.0 instance?

Solution

PolarDB-X 1.0 provides the evaluation and import feature to help you efficiently migrate data from an ApsaraDB RDS instance to a PolarDB-X 1.0 instance.

Table 1. Migration process

Step

Description

Step 1: Obtain evaluation suggestions

The PolarDB-X 1.0 evaluation suggestions include the following aspects:

  • The type of the destination PolarDB-X 1.0 instance and the specifications of the ApsaraDB RDS instance from which you import data to the PolarDB-X 1.0 instance.

  • A sharding solution for each table in the source ApsaraDB RDS instance, including whether to shard the table, which column to use as the shard key, and the table creation statement used when the table is imported to the PolarDB-X 1.0 instance.

Step 2: Import data

PolarDB-X 1.0 allows you to import data in the following ways:

  • Evaluation-based import: Provide an integrated migration solution to quickly create databases, create tables, and import data based on the evaluation suggestions.

    Figure 1. Task execution process 任务执行流程

  • Custom import: You can purchase PolarDB-X 1.0 and RDS instances, create databases and tables based on your business requirements, and then import data from the source ApsaraDB RDS instance to the destination PolarDB-X 1.0 instance.

    Figure 2. Task execution process任务执行流程

Step 3: Complete the migration

PolarDB-X 1.0 performs incremental data synchronization for 14 days after the full data synchronization task is completed. After all data is imported, you can switch your business from the ApsaraDB RDS instance to the PolarDB-X 1.0 instance.

Step 1: Obtain evaluation suggestions

PolarDB-X 1.0 can evaluate the source RDS instance and provide suggestions for migration to the destination PolarDB-X 1.0 instance. All suggestions are displayed in the evaluation report.

  1. Log on to the PolarDB-X 1.0 console.

  2. In the top navigation bar, select the region where the instance is deployed.

  3. In the left-side navigation pane, choose Import Evaluation > Suggestions.

  4. In the upper-right corner of the Suggestions page, click Start ApsaraDB RDS Evaluation.

    开始

  5. On the Source Database Information page, configure the parameters. The following table describes the parameters.

    Parameter

    Description

    Parameter

    Description

    Task Name

    Specify the name of the migration task.

    Source Database Information

    Instance Type

    The parameter is automatically set to ApsaraDB RDS Instance. You do not need to specify this parameter.

    ApsaraDB RDS Instance ID

    Select the source ApsaraDB RDS instance.

    Database Name

    Select the source database.

    Database Port

    Enter the port number of the source database.

    Database Account

    Enter the account of the source database.

    Database Password

    Enter the password of the source database account.

    Note

    After you enter the account and password of the source database, click Test Connection on the right to check whether the source ApsaraDB RDS instance can be connected.

    Business Information

    You can configure the Expected Data Size Growth in Percentage and Expected Average QPS Growth in Percentage parameters based on your business requirements to obtain more accurate evaluation suggestions.

    Evaluation Duration

    You can set the Evaluation Duration parameter to 1 hour, 3 hours, 6 hours, 1 day, 3 days, or 7 days. You can also specify a custom evaluation duration from 1 to 336 hours (14 days).

  6. Select Agree to Enable SQL Explorer and click Next.

  7. On the Task Precheck page, click Start Task when the precheck result displays Successful.

  8. After the evaluation task is completed, perform the following steps:

    评估完成

    • Click Evaluation Report in the Actions column corresponding to the task to view the evaluation details.报告

      Note

      You can click Show in the Recommended Sharding Result section to view the details of sharding, such as the sharding type and shard key. You can also click Export Table Creation SQL Statement to download the SQL statements that are used to create tables.

    • You can click Start Import in the Actions column to import data.

Step 2: Import data

You can use one of the following methods to import data from the source ApsaraDB RDS instance to the destination PolarDB-X 1.0 instance:

  • Evaluation-based import

    1. Log on to the PolarDB-X 1.0 console.

    2. In the top navigation bar, select the region in which the destination PolarDB-X 1.0 instance is deployed.

    3. In the left-side navigation pane, choose Import Evaluation > Suggestions.

    4. Find the task and click Start Import in the Actions column.导入

    5. On the Evaluation Summary page, confirm the type and number of the recommended instances, and then click Next.

    6. Select the destination PolarDB-X 1.0 instance and click the 图标 icon to add the instance to the selected section on the right, and then click Next.

      Note

      You can select only one destination PolarDB-X 1.0 instance.

    7. Select the source ApsaraDB RDS instance, click the 图标 icon to add the instance to the selected section on the right, and then click Next.

      Note

      You can continue to use the purchased ApsaraDB RDS instance. However, we recommend that you purchase a new ApsaraDB RDS instance as a separate storage resource for the PolarDB-X 1.0 instance.

    8. On the Task Precheck page, click Next when the precheck result displays Successful.

    9. On the Confirm Topology page, confirm the source ApsaraDB RDS instance, source database, and destination PolarDB-X 1.0 instance, and click Create Task.

  • Custom import

    1. Log on to the PolarDB-X 1.0 console.

    2. In the top navigation bar, select the region in which the destination PolarDB-X 1.0 instance is deployed.

    3. In the left-side navigation pane, choose Import Evaluation > Import Data.

    4. In the upper-right corner of the Import Task page, click ApsaraDB RDS Custom Import.

    5. On the Source and Destination Database page, configure the parameters and click Next. The following table describes the parameters.

      Parameter

      Description

      Parameter

      Description

      Task Name

      Specify the name of the migration task.

      Source Database Information

      Instance Type

      The parameter is automatically set to ApsaraDB RDS Instance. You do not need to specify this parameter.

      ApsaraDB RDS Instance ID

      Select the source ApsaraDB RDS instance.

      Database Name

      Select the source database.

      Database Port

      Enter the port number of the source database.

      Database Account

      Enter the account of the source database.

      Database Password

      Enter the password of the source database account.

      Note

      After you enter the account and password of the source database, click Test Connection to check whether the source ApsaraDB RDS instance can be connected.

      Destination Database Information

      Database Port

      Enter the port number of the destination database.

      Database Account

      Enter the account of the destination database.

      Database Password

      Enter the password of the destination database account.

      Note

      After you enter the account and password of the destination database, click Test Connection to check whether the destination PolarDB-X 1.0 instance can be connected.

    6. On the Migration Task page, select the source table from the Source Table Name column on the left, select the destination table from the Destination Table Name column on the right, and then click Next.

      Important

      You cannot migrate tables that use a composite primary key. If you migrate such tables, an error occurs in the Task Precheck step.

    7. On the Task Precheck page, click Start Task when the precheck result displays Successful.

Step 3: Complete the migration

  1. Log on to the PolarDB-X 1.0 console.

  2. In the top navigation bar, select the region where the instance is deployed.

  3. In the left-side navigation pane, choose Import Evaluation > Import Data.

  4. Find the task and click End Task in the Actions column.

    结束任务

    Note
    • PolarDB-X 1.0 performs incremental data synchronization for 14 days after the full data synchronization task is completed. When the task progress Task Progress is displayed as 100%, you can click End Task to manually complete the migration. You can also wait for the system to automatically end the task after the 14-day incremental data synchronization expires.

    • When the task status is changed from Running to Completed, you can click Clear Task to clear the task. A cleared task is not displayed in the task list.

FAQ

Do I need to suspend write operations on the source database before I start to import data?

No, PolarDB-X 1.0 performs incremental data synchronization for 14 days after the full data synchronization task is completed. After the progress bar in the Task Progress column is displayed as 100%, you can click End Task to manually complete the migration. You can also wait for the system to automatically end the task after the 14-day incremental data synchronization expires.

  • On this page (1, T)
  • Issues to consider
  • Solution
  • Step 1: Obtain evaluation suggestions
  • Step 2: Import data
  • Step 3: Complete the migration
  • FAQ
Feedback
phone Contact Us