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 to 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 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 migrates the schemas of the required objects from the sandbox instance to the ApsaraDB RDS for MySQL instance.

  • Full data migration

    DTS migrates historical data of the required objects from the sandbox instance to the ApsaraDB RDS for MySQL instance.

  • Incremental data migration

    After full data migration is complete, DTS synchronizes incremental data from the sandbox instance to the ApsaraDB RDS for MySQL instance. Incremental data migration allows you to migrate data without downtime.

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

Procedure

  1. Log on to the DTS console. In the left-side navigation pane, click Data Migration. In the upper part of 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. In the Configure Source and Destination Databases step, configure the source and destination for the data migration task.
    Configure Source and Destination Databases
    Section Parameter Description
    N/A Task Name The name of the data migration task. DTS automatically generates a task name. We recommend that you set a descriptive name that is easy to identify. Task names do not have to be unique.
    Source Database Instance Type The deployment mode of the sandbox instance. 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 The engine of the sandbox instance. Select MySQL from the drop-down list.
    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 backed up to the sandbox instance.
    Database Password The password of the account that is used to connect to the sandbox instance.
    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 The deployment mode of the ApsaraDB RDS for MySQL instance. Select RDS Instance.
    Instance Region The region where the ApsaraDB RDS for MySQL instance resides.
    RDS Instance ID The ID of the ApsaraDB RDS for MySQL instance. We recommend that you select an instance whose 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 account that is used to connect to the ApsaraDB RDS for MySQL instance.
    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.
    Encryption The type of the connection that you want to establish. Select Non-encrypted or SSL-encrypted based on your needs. 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 ApsaraDB RDS for MySQL instance. This ensures that DTS servers can connect to the ApsaraDB RDS for MySQL instance.
  5. Select the migration types and the objects to be migrated.
    Configure Migration Types and Objects
    Parameter Description
    Migration Types
    • To perform only full data migration, select Schema Migration and Full Data Migration.
    • To migrate data with minimal downtime, 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 sandbox instance during full data migration. This ensures data consistency between the sandbox instance and ApsaraDB RDS for MySQL instance.
    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 ApsaraDB RDS for MySQL instance, the name of the object remains unchanged. You can use the object name mapping feature to rename the objects that are migrated to the ApsaraDB RDS for MySQL instance. For more information, see Object name mapping.
    • If you use the object name mapping feature to rename an object, the objects that depend 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 ApsaraDB RDS for MySQL instance. For more information, see Object name mapping.
    Retry Time for Failed Connections By default, if DTS fails to connect to the sandbox instance or ApsaraDB RDS for MySQL instance, DTS retries within the next 720 minutes (12 hours). You can specify the retry time based on your needs. If DTS reconnects to the sandbox instance and ApsaraDB RDS for MySQL instance within the specified amount of time, DTS resumes the data migration task. Otherwise, the data migration task fails.
    Note When DTS retries a connection, you are charged for the DTS instance. We recommend that you specify the retry time based on your business needs. You can also release the DTS instance at your earliest opportunity after the sandbox instance and ApsaraDB RDS for MySQL instance are released.
    Replicate Temporary Tables When DMS Performs DDL Operations If you use Data Management (DMS) to perform online DDL operations on the sandbox instance, 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 data 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 sandbox instance 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 is incomplete. You need only to wait until the data migration task is complete.
    • 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 manually stop the task.
      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 ApsaraDB RDS for MySQL instance.
      1. Wait until Incremental Data Migration and The migration task is not delayed appear in the progress bar of the data migration task. Then, stop writing data to the sandbox instance for a few minutes. The delay time may appear in the status of incremental data migration.
      2. Wait until the status of incremental data migration changes to The migration task is not delayed again. Then, manually stop the data migration task.Stop a task during incremental data migration
    Switch your workloads to the ApsaraDB RDS for MySQL instance.