This topic describes how to restore the data of an ApsaraDB RDS for MySQL instance.

Prerequisites

The original RDS instance whose data you want to restore must meet the following requirements:

  • The original RDS instance is in the Running state and is not locked.
  • The original RDS instance does not have ongoing migration tasks.
  • If you want to restore data to a point in time, the log backup feature is enabled for the original RDS instance.
  • If you want to restore data from a backup set, the original RDS instance has at least one completed physical backup. For more information, see Perform automatic backups and manual backups for an ApsaraDB RDS for MySQL instance.

For more information about how to restore the data of RDS instances that run other database engines, see the following topics:

Background information

You can use one of the following methods to restore the data of the original RDS instance:
  • Method 1: Restore the data of the original RDS instance to a new RDS instance, verify the data on the new RDS instance, and then migrate the data from the new RDS instance back to the original RDS instance. This function was previously known as instance cloning. This topic describes this restoration method.
  • Method 2: Restore the data of individual databases or tables to the original RDS instance or to a new RDS instance. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance.
  • Method 3: Restore the data of the original RDS instance to a new or existing RDS instance that resides in a different region than the original RDS instance. For more information, see Restore the data of an ApsaraDB RDS for MySQL instance across regions.

Precautions

  • The new RDS instance must have the same whitelist, backup, and parameter settings as the original RDS instance.
  • The data information of the new RDS instance must be the same as the data information that is indicated by the specified data or log backup file of the original RDS instance.
  • The account information of the new RDS instance must be the same as the account information that is indicated by the specified data or log backup file of the original RDS instance.

Billing

You must pay for the new RDS instance. For more information, see Pricing, billable items, and billing methods.

Note If you use Alibaba Cloud Data Transmission Service (DTS) to migrate the data from the new RDS instance back to the original RDS instance, you are not charged for the schema migration or full data migration.

Restore data to a new RDS instance

  1. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Backup and Restoration.
  3. Click Restore Database (Previously Clone Instance).
  4. Configure the following parameters.
    Parameter Description
    Billing Method
    • Subscription: A subscription instance is an instance that you can subscribe to for a specified period and pay for up front. Subscription billing is more cost-effective than pay-as-you-go billing. Therefore, we recommend that you select subscription billing with a longer commitment. You can receive larger discounts for longer subscription periods.
    • Pay-As-You-Go: A pay-as-you-go instance is charged per hour based on your actual resource usage. We recommend that you select pay-as-you-go billing for short-term use. If you no longer need your pay-as-you-go instance, you can release it to reduce costs.
    Restore Mode
    • By Time: allows you to restore data to a point in time within the specified log retention period. The time is accurate to the second. For more information about how to view or change the log backup retention period, see Perform automatic backups and manual backups for an ApsaraDB RDS for MySQL instance.
    • By Backup Set: allows you to restore data from a specified backup set. You can restore data only from the backup set that is generated from a physical backup. You cannot restore data from the backup set that is generated from a logical backup.
    Note The By Time option appears only when the log backup function is enabled.
    Zone

    A zone is an independent physical location within a region. The Zone of Primary Node parameter specifies the zone to which the primary RDS instance belongs. The Zone of Secondary Node parameter specifies the zone to which the secondary RDS instance belongs.

    You can select the Single-zone Deployment or Multi-zone Development method.

    • Single-zone Deployment: If you select this deployment method, the Zone of Primary Node and the Zone of Secondary Node are the same.
    • Multi-zone Development: This is the recommended deployment method. If you select this deployment method, the Zone of Primary Node and the Zone of Secondary Node are different. This allows you to provide zone-level disaster recovery. You must manually specify the Zone of Primary Node and the Zone of Secondary Node.
    Note
    • After the RDS instance is created, you can view information about the RDS instance and its secondary RDS instance on the Service Availability page.
    • If you select the RDS Basic Edition, the database system consists of only one primary RDS instance and supports only the single-zone deployment method.
    Instance Type
    • General-purpose (Entry-level): belongs to the general-purpose instance family. A general-purpose instance exclusively occupies the allocated memory and I/O resources. However, it shares CPU and storage resources with the other general-purpose instances that are deployed on the same server.
    • Dedicated Instance (Enterprise-level): belongs to the dedicated instance family or the dedicated host instance family. A dedicated instance exclusively occupies the allocated CPU, memory, storage, and I/O resources. The dedicated host instance family is the top configuration of the dedicated instance family. A dedicated host instance exclusively occupies all the CPU, memory, storage, and I/O resources on the server where it is deployed.
    • Dedicated: A dedicated cluster exclusively occupies all the resources on a VM or physical host. The permissions to manage hosts in a dedicated cluster can be authorized to you. This allows you to create multiple database instances on a host. For more information, see Add hosts.
    Note Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum IOPS. For more information, see Primary instance types.
    Capacity The storage capacity that the RDS instance has available to store data files, system files, binary log files, and transaction files. You can adjust the storage capacity in increments of 5 GB.
    Note
    • If you select the local SSD storage type, the storage capacity of the RDS instance may vary based on the instance type. If you select the standard or enhanced SSD storage type, this limit does not apply. For more information, see Primary instance types.
    • If you select the RDS High-availability Edition and the standard or enhanced SSD storage type, Automatic Storage Expansion is selected by default. You can specify the trigger conditions and upper limit for automatic storage expansion. If the trigger conditions are met, ApsaraDB RDS automatically adds 5 GB of storage or 15% of the purchased storage capacity depending one whichever is larger. This prevents the created RDS instance from being locked due to insufficient storage space.
  5. Click Next: Instance Configuration.
  6. Configure the following parameters.
    Parameter Description
    Network Type
    • Classic Network: the traditional type of network.
    • VPC: the recommended type of network. A virtual private cloud (VPC) is an isolated virtual network that provides higher security and better performance than the classic network. If you select the VPC network type, you must also specify the VPC parameter and the vSwitch of Primary Node parameter. If you select the Multi-zone Deployment method in the Basic Configurations step, you must specify both the VSwitch of Primary Node and VSwitch of Secondary Node parameters.
    Note The RDS instance must have the same network type as the ECS instance that you want to connect. If the RDS and ECS instances both have the VPC network type, these instances must also reside in the same VPC. Otherwise, these instances cannot communicate over an internal network.
  7. Click Next: Confirm Order.
  8. Confirm the settings in the Parameters section, specify the Purchase Plan and Duration parameters, read and select Terms of Service, and then click Pay Now. You must specify the Duration parameter only when the new RDS instance uses the subscription billing method.
    Note If the new RDS instance uses the subscription billing method, we recommend that you select Auto-Renew Enabled. This relieves the need to renew the instance on a regular basis and avoids interruptions to your workloads due to overdue payments.

Verify data on the new RDS instance

For more information, see Connect to an ApsaraDB RDS for MySQL instance.

Migrate data to the original RDS instance

After you verify the data on the new RDS instance, you can migrate the data from the new RDS instance back to the original RDS instance. For more information, see Migrate data between RDS instances.

Note The migration does not interrupt the workloads on the original RDS instance.

FAQ

  • How do I restore a database that I accidentally deleted?

    ApsaraDB RDS allows you to restore only the database that you accidentally deleted. For more information, see Restore individual databases and tables of an ApsaraDB RDS for MySQL instance. If your RDS instance does not support the restoration of individual databases or tables, you can restore the data of the database that you accidentally deleted to a new RDS instance, verify the data on the new RDS instance, and then migrate the data from the new RDS instance back to the original RDS instance.

  • If my RDS instance does not have a data backup, can I restore the data to a point in time?

    No, if your RDS instance does not have a data backup, you cannot restore the data to a point in time. To restore the data to a point in time, you must restore the data from a full data backup that was completed before the specified point in time. Then, you must restore the incremental data from the log backup file that was generated at the specified point in time.

  • When I create an RDS instance to which data is restored, why am I unable to select a vSwitch for my primary RDS instance?

    If no vSwitches are available in the zone that you specified in the Basic Configurations step, you cannot select a vSwitch for your primary RDS instance in the Instance Configuration step. In this case, click go to the VPC console. In the VPC console, create a vSwitch. Then, you can select a vSwitch for your primary RDS instance.