This topic describes how to restore the data of an RDS MySQL instance by using a data backup.

For more information about how to restore the data in other database engines, see the following topics:

Background information

You can use any of the following methods to restore the data of an RDS for MySQL instance:

Prerequisites

The original instance must meet the following conditions:

  • It is running and is not locked.
  • It does not have an ongoing migration task.
  • To restore data by time, you must make sure that the log backup function is enabled.
  • To restore data by backup set, you must make sure that the original instance has at least one backup set.

Precautions

  • The new instance must have the same whitelist, backup, and parameter settings as the original instance.
  • The data information of the new RDS instance must be the same as that of the created RDS instance or from the specified time point.
  • The new RDS instance carries the account information in the used backup file or that from the specified time point.

Billing

The data is restored to the new instance, so the new instance fee is charged. For more information, see Pricing, billing items, and billing methods.

Note If you use DTS to migrate data from a new instance to the original instance, you are not charged for schema migration and full migration.

Restore data to a new instance

  1. Log on to the ApsaraDB for RDS console.
  2. Select the region where the target instance is located.Select a region
  3. Click the ID of the instance.
  4. In the left-side navigation pane, select Backup and Restoration.
  5. In the upper-right corner of the page, click Restore Database (Previously Clone Database).
  6. Configure the following parameters.
    Parameter Description
    Billing Method
    • Subscription: You must pay the subscription fee when you create an instance. We recommend that you select subscription billing for long-term use because it is more cost-effective than pay-as-you-go billing. You will receive larger discounts for longer subscription periods.
    • Pay-As-You-Go: A pay-as-you-go instance is charged hourly based on your actual resource usage. We recommend that you select pay-as-you-go billing for short-term use. You can release your pay-as-you-go instance to reduce costs when you no longer need it.
    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 seconds. For more information about how to view or change the retention period of log backups, see Back up an ApsaraDB RDS MySQL instance.
    • By Backup Set: allows you to restore data from a data backup file.
    Note By Time is displayed only when the log backup feature is enabled.
    Zone of Primary Node

    The zone of primary node where the RDS instance resides. Each zone is an independent physical location within a region. There is no substantive difference between zones in the same region. If your database system spans multiple zones, it provides zone-level disaster recovery.

    You only need to select a primary zone. The system automatically assigns a secondary zone to the RDS instance.

    Deployment Method You can set the instance as multi-zone or single-zone deployment.
    Instance Type
    • Entry-level: belongs to the general-purpose instance family. A general-purpose instance occupies the exclusive memory and I/O resources allocated to it, but shares CPU and storage resources with the other general-purpose instances that are deployed on the same server.
    • Enterprise-level: belongs to the dedicated instance family. A dedicated instance occupies exclusive CPU, memory, storage, and I/O resources. The top configuration of the dedicated instance family is the dedicated host. A dedicated host instance occupies all CPU, memory, storage, and I/O resources on the server where it resides.
    Note Each instance type supports a specific number of CPU cores, memory capacity, maximum number of connections, and maximum input/output operations per second (IOPS). For more information, see Primary instance types.
    Storage The storage space of the instance, including the space for data, system files, binary log files, and transaction files. The storage capacity increases in increments of 5 GB.
    Note The dedicated instance family supports exclusive allocations of resources. Therefore, the storage capacity of each instance type with local SSDs in this family is fixed. For more information, see Primary instance types.
  7. Click Next: Instance Configuration.
  8. Configure the following parameters.
    Parameter Description
    Network Type
    • Classic Network: a traditional type of network.
    • VPC: A virtual private cloud (VPC) is an isolated virtual network with higher security and better performance than the classic network. If you select the VPC network type, you must also specify VPC and VSwitch of Primary Node.
    Note Make sure that the RDS instance has the same network type as the ECS instance that you want to connect. If the RDS and ECS instances have different network types, they cannot communicate over an internal network. If the network types of the RDS and ECS instances are both VPC, you must also make sure that they reside in the same VPC.
  9. Click Next: Confirm Order.
  10. Confirm the settings in the Parameters section, specify Purchase Plan and Duration, read and select Terms of Service, and then click Pay Now. You need to specify Duration only when you create a subscription instance.
    Note For subscription instances, we recommend that you select Auto-Renew Enabled, which will free you from regular manual renewals and avoid business interruptions.

Log on to the new instance and verify the data

For more information about how to log on to an instance, see connect to an instance.

Migrate data to the original instance

After you verify the data in the new instance, you can migrate the data that you require from the new instance to the original instance. For more information, see Migrate data between ApsaraDB for RDS instances.

Note Data Migration refers to migrating data from one RDS instance (the source RDS instance) to another (the destination RDS instance). The data migration operation does not interrupt the source RDS instance.

FAQ

  • How can I restore a database that was accidentally deleted?

    You can restore a single database. For more information, see Restore individual databases or tables for an RDS MySQL instance. For instances that do not support data restoration, see this topic to restore all data to a new instance. After verification, migrate the data back to the original instance.

  • Can I restore data by time point without data backup?

    No, To restore data to a specified time point, you must first restore full backup data that was generated before the selected time point to the instance. Then, you can restore incremental data to the selected time point based on binlogs.

  • Why can't I select a vSwitch on the primary node during restoration?

    Because no vSwitch is available in the zone you selected in the previous step (basic configuration), you cannot select a primary vSwitch in the current step (network and resource group). You can click create in the console in the VPC console, create a vSwitch in the zone to select the primary vSwitch.