All Products
Search
Document Center

Migrate data from MySQL to DRDS

Last Updated: Sep 11, 2019

DTS allows you to migrate data from a MySQL instance to a DRDS instance. The incremental synchronization feature of DTS supports migration to the target DRDS instance without downtime of the MySQL service.

This topic describes how to configure a task for migrating data from a MySQL instance to a DRDS instance through DTS.

Data Sources

DTS supports migrations from MySQL to DRDS with the following types of instances.:

  • Local IDC external MySQL to DRDS
  • ECS external MySQL to DRDS
  • RDS to DRDS

Migration object

Because DRDS only supports tables, DTS supports the following migration objects:

  • Table (including all index definitions)
  • Partition table

Migration permission requirements

When you use DTS for data migration between MySQL and DRDS instances, note that the migration account permissions of the source and target databases for different migration types are as follows:

  • Local IDC external MySQL to DRDS instances
Migration type Schema migration Full migration Incremental migration
Local IDC external MySQL instance select select super
select
replication slave
replication client
Target DRDS instance Read/Write permissions Read/Write permissions Read/Write permissions
  • ECS external MySQL to DRD instance
Migration type Schema migration Full migration Incremental migration
ECS external MySQL instance select select super
select
replication slave
replication client
Target DRDS instance Read/Write permissions Read/Write permissions Read/Write permissions
  • RDS instance to DRDs instance
Migration type Structure migration Full migration Incremental migration
Source RDS Instance Read/Write permissions Read/Write permissions Read/Write permissions
Target DRDS instance Read/Write permissions Read/Write permissions Read/Write permissions

Configure a migration task

The following describes how to configure a task for migrating data from an RDS instance to a DRDS instance using DTS. For migration from an external MySQL instance to a DRDS instance, all the configurations except the source instance connection method remain the same.

Create a migration account

When you configure a migration task, you need to provide the migration account of the source RDS instance and the target RDS instance. For more information about permissions required for the migration account, see the preceding Migration permission requirements section.
If you have not created a migration account, Create an RDS instance account . Grant read and write permissions of the database to be migrated to the migration account.

Configure a migration task

After all of the preceding prerequisites are met, you can start to configure a migration task. To configure a migration task, follow these steps:

  1. Log on to the DTS console, and click Create migration task on the upper-right corner of the console to start migration task configuration.
  2. Configure the information of the source and target instance.

You need to configure themigration task name,the source RDS instance connection information , and the target DRDS instance connection information. You need to configure the following:

  • Task name

DTS generates a name for every task automatically. The task name is not required to be unique. You can modify the task name as required. We recommend that you specify a meaningful name so that the task can be easily identified.

  • Source instance information

    • Instance type: Select RDS instance in this example. If the RSD instance is an external MySQL database in the local IDC, choose On-premises databases. If it is an external MySQL database on ECS, choose ECS-based databases.
    • Source instance region: select the region where the RDS instance is located. If the RDS instance is an external MySQL instance in the local IDC, choose the region closest to the external MySQL database. If it is an external MySQL on the ECS, then choose the region where the ECS is located.
    • RDS instance ID: Configure the instance ID of the source RDS instance. DTS supports RDS instances in classic networks and VPC networks.
    • Database account: The account for access to the source RDS instance.
    • Database password: The password of the preceding database account.
  • Target instance information

    • Target instance region: Select DRDS instances.
    • Instance region: Region where the DRDS instance is located.
    • DRDS instance ID: Configure the instance ID of the target DRDS instance to which you want to migrate data. DTS supports DRDS instances in classic networks and VPC networks.
    • Database name: Name of the DRDS database to which you want to migrate data.
    • Database account: The account for connecting to the DRDS database.
    • Database password: The password of the preceding database account.

After you configure the connection information, click Authorize whitelist and enter into next step to add entries to the whitelist. In this step, DTS adds the IP address of the DTS server to the whitelist of the RDS and DRDS instances. This prevents connection issues where the DTS service cannot connect to the required RDS and DRDS instances for data migration.

3. Select migration objects and migration type

  • Migration type

DTS supports migration types including schema migration, full migration, and incremental migration.
If you only need full migration, select Migrate object schema, and Migrate existing data as the migration type.
If you need to migrate without downtime, select Migrate object schema, Migrate existing data, and Migrate data changes as the migration type.

  • Migration object

In this step, select the object to be migrated. The migration objects can be databases, tables, and columns. By default, when an object is migrated to a target DRDS instance, the object name remains the same as in the source RDS instance. If the object you migrate has different names in the source instance and the target instance, you need to use the object name mapping feature provided by DTS. For more information, see Map databases, tables, and columns.

4. Pre-check

A pre-check is performed before a migration task is started. Migration can be started only if the pre-check is successful.
If the pre-check fails, click Details corresponding to a specific check to see details. Fix the errors accordingly, and then perform a pre-check again.

Migration between RDS instances_Step 3

5. Start the migration task

After the pre-check is passed, you can start the migration task and view the detailed status of the migration and the migration progress in the task list.

If you select incremental migration, after the process enters the incremental migration phase, the updates made to the source database are synchronized to the target DRDS instance by DTS. The migration task does not end automatically. If you only want to migrate existing data, we recommend that you pause updates to the source instance for a few minutes when the incremental migration does not delay, wait for the incremental migration to return to a no-delay status, and then stop the migration task and simply switch the business to the target DRDS instance.

You have completed the configuration of the data migration from a MySQL instance to a DRDS instance.