After a sandbox instance is created for emergency disaster recovery, you can use Data Transmission Service (DTS) to migrate data from the sandbox instance to an ApsaraDB RDS for MySQL instance.

Background information

Database Backup (DBS) provides a sandbox solution based on copy data management (CDM). You can create independent DBS sandbox instances with ease to make your backup data available in a short period of time. For more information, see Overview.

After a sandbox instance is created for emergency disaster recovery, you can use DTS to migrate data from the sandbox instance to an ApsaraDB RDS for MySQL instance. This operation applies to the following scenarios:
  • Save the data that is written in a sandbox instance. Read and write operations performed within sandbox instances do not affect source databases. To save the data that is written to a sandbox instance, you can migrate the data from the sandbox instance to an ApsaraDB RDS for MySQL instance.
  • Accelerate restoration. Compared with the regular restoration methods provided by DBS, the DBS sandbox feature accelerates the restoration of backup sets. You can use the DBS sandbox instance feature to create a sandbox instance for emergency disaster recovery and then migrate the tables or databases in the sandbox instance to an ApsaraDB RDS for MySQL instance.

Prerequisites

Precautions

  • Data migration does not affect the data in the sandbox instance. During data migration, DTS reads the data in the sandbox instance and copies the data to the ApsaraDB RDS for MySQL instance. DTS does not delete the data in the sandbox instance.
  • To ensure data consistency, we recommend that you do not write data to the sandbox instance during full data migration.

For more information, see Precautions and limits for migrating data from a MySQL database.

Migration types and billing rules

  • Schema migration

    DTS can be used to migrate the schemas of objects from an ApsaraDB RDS for MySQL source instance to a destination instance.

  • Full data migration

    You can migrate the data of all objects from an ApsaraDB RDS for MySQL source instance to a destination instance by using DTS. This is called a full data migration operation.

  • Incremental data migration

    After all data of an ApsaraDB RDS for MySQL source instance is migrated to a destination instance, you can synchronize the incremental data of the source instance to the destination instance by using DTS. This is called an incremental data migration operation. Incremental data migration ensures service continuity when you migrate data between self-managed databases.

You are not charged for schema migration and full data migration. We recommend that you perform only schema migration and full data migration. You are charged for incremental data migration. For more information, see Billing methods.

Procedure

  1. Log on to the DTS console. In the left-side navigation pane, click Data Migration. In the upper part on the Migration Tasks page, select the region where the sandbox instance that you created resides.
    Select a region
  2. In the upper-right corner of the page, click Create Migration Task.
  3. Configure source and destination databases.
    Configure the source and destination instances
    Section Parameter Description
    N/A Task Name DTS automatically generates a task name. We recommend that you specify a descriptive name to identify the task. The task name does not have to be unique.
    Source Database Instance Type Select User-Created Database Connected over Express Connect, VPN Gateway, or Smart Access Gateway.
    Instance Region The region where the sandbox instance resides.
    Peer VPC The virtual private cloud (VPC) that is used to connect to the sandbox instance. To view the VPC, go to the VPCs page.
    Database Type Select MySQL.
    IP Address The endpoint that is used to connect to the sandbox instance. You can obtain the endpoint on the details page of the sandbox instance.
    Port Number The port number that is used to connect to the sandbox instance. Default value: 3306.
    Database Account The username of the account that is used to connect to the sandbox instance.
    • To perform schema migration and full data migration, make sure that the account has the SELECT permission.
    • To perform incremental data migration, make sure that the account has the REPLICATION CLIENT, REPLICATION SLAVE, SHOW VIEW, and SELECT permissions.
    Note The username and password of the sandbox instance must be consistent with those of the database whose data was migrated to the sandbox instance.
    Database Password The password of the database account.
    Note After you specify the source database parameters, click Test Connectivity next to Database Password to verify whether the specified parameters are valid. If the specified parameters are valid, the Passed message appears. If the Failed message appears, click Check next to Failed. Modify the source database parameters based on the check results.
    Destination Database Instance Type Select RDS Instance.
    Instance Region Select the region where the ApsaraDB RDS for MySQL destination instance resides.
    RDS Instance ID The ID of the ApsaraDB RDS for MySQL instance. We recommend that you select an instance whose engine version is the same as that of the sandbox instance, or later than that of the sandbox instance.
    Database Account The username of the account that is used to connect to the ApsaraDB RDS for MySQL instance. The account must have the read and write permissions on the ApsaraDB RDS for MySQL instance.
    Database Password The password of the database account.
    Note After you specify the destination database parameters, click Test Connectivity next to Database Password to verify whether the parameters are valid. If the specified parameters are valid, the Passed message appears. If the Failed message appears, click Check next to Failed. Modify the destination database parameters based on the check results.
    SSL Encryption Select Non-encrypted or SSL-encrypted. If you want to select SSL-encrypted, you must enable SSL encryption for the ApsaraDB RDS for MySQL instance before you configure the data migration task. For more information, see Configure SSL encryption on an ApsaraDB RDS for MySQL instance.
  4. In the lower-right corner of the page, click Set Whitelist and Next.
    Note DTS adds the CIDR blocks of DTS servers to the whitelist of the destination instance. This ensures that DTS servers can connect to the destination instance.
  5. Select the migration type and the objects to be migrated.
    Value
    Parameter Description
    Migration Type
    • To perform only full data migration, select Schema Migration and Full Data Migration.
    • To ensure service continuity during data migration, select Schema Migration, Full Data Migration, and Incremental Data Migration.
    Notice If Incremental Data Migration is not selected, we recommend that you do not write data to the source database during full data migration. This ensures data consistency between the source and destination databases.
    Available

    Select one or more objects from the Available section and click the Rightwards arrow icon to move the objects to the Selected section.

    Notice
    • You can select columns, tables, or databases as the objects to be migrated.
    • By default, after an object is migrated to the destination database, the name of the object remains unchanged. You can use the object name mapping feature to rename the objects that are migrated to the destination database. For more information, see Object name mapping.
    • If you use the object name mapping feature to rename an object, other objects that are dependent on the object may fail to be migrated.
    Rename Databases and Tables You can use the object name mapping feature to rename the objects that are migrated to the destination instance. For more information, see Object name mapping.
    Retry Time for Failed Connections By default, if DTS fails to connect to the source or destination database, DTS retries within the next 720 minutes (12 hours). You can specify the retry time based on your needs. If DTS reconnects to the source and destination databases within the specified time, DTS resumes the data migration task. Otherwise, the data migration task fails.
    Note If DTS retries a connection, you are charged for the operation of the DTS instance. We recommend that you specify the retry time based on your business needs and release the DTS instance at your earliest opportunity after the source and destination instances are released.
    Replicate Temporary Tables When DMS Performs DDL Operations If you use Data Management (DMS) to perform online DDL operations on the source database, you can specify whether to migrate temporary tables generated by online DDL operations.
    • Yes: DTS migrates the data of temporary tables generated by online DDL operations.
      Note If online DDL operations generate a large amount of data, the migration task may be delayed.
    • No: DTS does not migrate the data of temporary tables generated by online DDL operations. Only the original DDL data of the source database is migrated.
      Note If you select No, the tables in the ApsaraDB RDS for MySQL instance may be locked.
  6. In the lower-right corner of the page, click Precheck.
    Note
    • Before you can start the data migration task, a precheck is performed. You can start the data migration task only after the task passes the precheck.
    • If the task fails to pass the precheck, you can click the Info icon icon next to each failed item to view details.
      • You can troubleshoot the issues based on the causes and run a precheck again.
      • If you do not need to troubleshoot the issues, you can ignore failed items and run a precheck again.
  7. After the task passes the precheck, click Next.
  8. In the Confirm Settings dialog box, specify the Channel Specification parameter and select Data Transmission Service (Pay-As-You-Go) Service Terms.
  9. Click Buy and Start to start the data migration task.
    • If you select Schema Migration and Full Data Migration when you create the data migration task, we recommend that you do not manually stop the task. Otherwise, the data migrated to the ApsaraDB RDS for MySQL instance may be incomplete. You can wait until the data migration task stops automatically.
    • If you select Schema Migration, Full Data Migration, and Incremental Data Migration when you create the data migration task, the task does not automatically stop. You must stop the task manually.
      Notice We recommend that you select an appropriate time to manually stop the data migration task. For example, you can stop the task during off-peak hours or before you switch your workloads to the destination cluster.
      1. Wait until Incremental Data Migration and The migration task is not delayed appear in the progress bar of the migration task. Then, stop writing data to the source database for a few minutes. The delay time of incremental data migration may be displayed in the progress bar.
      2. Wait until the status of incremental data migration changes to The migration task is not delayed again. Then, stop the migration task manually. Stop an incremental data migration task
    Switch your workloads to the ApsaraDB RDS for MySQL instance.