All Products
Search
Document Center

Data Management:Emergency recovery for a self-hosted MySQL database

Last Updated:Jun 22, 2026

Data Disaster Recovery provides a cloud disaster recovery solution for self-hosted MySQL databases. Based on copy data management (CDM) technology, it uses backup data to quickly create a temporary ApsaraDB RDS for MySQL instance as a disaster recovery instance. Typical use cases include backing up data to the cloud, cloud-based disaster recovery, recovery drills, development and testing, and query analysis.

Note

Prerequisites

Your self-hosted MySQL database runs version 5.7 or 8.0.

Billing

This solution involves the following fees:

Billable item

Description

Sandbox storage fee

After you enable the sandbox feature for Data Disaster Recovery, the service allocates a sandbox storage space for each database instance. The system automatically synchronizes data from the database instance to the sandbox storage and creates multiple sandbox snapshots. Data Disaster Recovery charges a sandbox storage fee based on the amount of data stored. For more information, see Billable items (Data Disaster Recovery).

Temporary RDS instance fee

Data is restored to a new pay-as-you-go RDS instance that serves as a temporary sandbox, so a fee is charged for this instance. The actual fee is subject to the final bill.

Note

Step 1: Create a backup schedule

Go to the DBS purchase page to create a backup schedule. For more information, see Create a backup schedule.

Note

On the buy page, select MySQL for Database Type and Physical Backup for Backup Method.

Step 2: Configure the backup schedule

For more information, see Configure a physical backup schedule for a MySQL database.

Step 3: Configure a disaster recovery policy

Enable the sandbox feature and configure a sandbox policy to quickly restore data to an RDS temporary instance that serves as a disaster recovery instance.

  1. Log on to Data Management Service (DMS) 5.0.

  2. In the top navigation bar, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. On the Backup Schedules page, click Manage in the Actions column corresponding to a backup schedule.
  4. On the Configure Task page, click Set Sandbox Feature in the Sandbox Information section.

  5. In the Set Sandbox Policy dialog box, enable the sandbox and set the data retention period in days.

    Parameter

    Description

    Sandbox feature

    Turn on the switch to enable this feature.

    Sandbox data retention period

    Specifies how many days sandbox snapshots are retained. The default retention period is 7 days.

    • A sandbox snapshot becomes available after creation and is automatically deleted when its retention period ends. Deletion removes only the incremental snapshot backup, that is, the changes relative to the previous snapshot.

    • A longer retention period requires more storage space and incurs higher storage fees.

    • If you want to keep only the most recent snapshot, you can set the retention period to 0.

  6. Click OK.

    After you enable the sandbox feature, the Sandbox Instance Time Range in the DBS console displays Data preparing. The first time you enable the feature, the system copies the latest full backup set to the sandbox storage and generates a mountable snapshot. Depending on the size of the backup data, this process may take 5 to 20 minutes.

    When the Sandbox Instance Time Range displays a specific available time range, you can create an RDS temporary instance and restore data to it.

    When the sandbox feature is ready, the Sandbox Information panel also displays status information such as Instance Count and Total Sandbox Storage Capacity.

    The following table describes the Sandbox instance time range status.

    Sandbox state

    Description

    Sandbox feature disabled

    Displays Not enabled.

    Preparation phase after enabling

    Displays Data preparing.

    Preparation complete

    Displays the restorable time range for the sandbox instance.

    Note

    This is the time range covered by the existing backup sets.

Step 4: Perform a disaster recovery

Create an RDS temporary instance to quickly restore data when a disaster occurs in your self-managed MySQL database.

Note
  • Reading and writing data in an RDS temporary instance will not affect the original self-managed MySQL database.

  • You can also use the restored RDS instance as a disaster recovery instance, and you have full control over its lifecycle. Data Disaster Recovery will not release your RDS instance.

  1. Log on to Data Management Service (DMS) 5.0.

  2. In the top navigation bar, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. Find the target backup schedule ID and click Manage in the Actions column on the right.

  4. On the Sandbox Instance Tasks page, click Recover Sandbox Instance.

  5. In the dialog box, configure the following parameters.

    Section

    Parameter

    Description

    Sandbox instance point in time

    Sandbox data time range

    Displays the recoverable time range from the first sandbox snapshot to the current time. The actual recoverable range may be shorter.

    Note

    Data can be recovered for the period from the first snapshot in the sandbox storage to the end time of the last binlog in the log backup. However, recovery is not guaranteed for data from the last binlog to the current time.

    Recovery method

    • Restore by snapshot time point: You can only select a time point from an existing snapshot, and the restoration time is shorter.

    • Recovery by custom point in time: If you enabled incremental log backup, you can restore to any point in time within the recoverable range. The recovery duration depends on the size of the logs that need to be applied. If incremental log backup is not enabled, you can restore only to the time points of full backups.

    Sandbox instance configurations

    Sandbox instance type

    RDS Instance. This is a fixed value.

    Edition

    Select the edition for the new sandbox instance. For more information, see Product Edition Overview.

    Instance region

    Defaults to the region of the backup schedule. This setting cannot be changed.

    Peer VPC

    Select Virtual Private Cloud (VPC).

    Note

    To access a sandbox instance from an ECS instance, ensure that the VPC where the ECS instance is located is selected here. To learn how to create a VPC, see Create and manage a Virtual Private Cloud.

    Peer vSwitch

    Select the target vSwitch to specify the IP address range for accessing the sandbox instance.

    Instance specification

    Select the specifications for the new sandbox instance. The available specifications are subject to what is displayed in the console.

  6. Click OK.

    The system runs a pre-check and automatically creates an RDS for MySQL temporary instance. When the Sandbox Instance Status changes to Completed, you can click the address link in the Sandbox Instance Address column to go to the RDS console and access the temporary instance.

    The sandbox instance list also displays information such as Recovery point in time, Sandbox instance specification, and Recovery duration. The Actions column provides a Release sandbox instance link. You can use this link to release the temporary instance when it is no longer needed.

Related operations

Disable disaster recovery policy (sandbox feature)

Note
  • Before you disable the sandbox feature, release all running sandbox instances. You can click Release Sandbox Instance in the Actions column of the target sandbox instance.

    This operation deletes only the sandbox instance recovery records in the DMS console and its association with the RDS instance. The actual RDS temporary instance is not deleted. If needed, release the temporary instance in the RDS console after your business tasks are complete.

  • After the sandbox feature is disabled, sandbox storage fees will no longer be generated.

Go to the Sandbox Instance Task page of the DBS backup schedule, click Set Sandbox Policy, and disable the sandbox feature.

Release disaster recovery instance (temporary instance)

If you no longer need the temporary ApsaraDB RDS for MySQL instance after your workload is complete, release it in the ApsaraDB RDS console. For more information, see Release or unsubscribe from an instance.