This topic describes how to use Database Backup (DBS) to restore a MySQL database from a logical backup.

Procedure

  1. Log on to the DBS console.
  2. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
  3. On the Backup Schedules page, find the ID of your backup schedule and click Manage in the Actions column.
  4. On the Configure Task page, click Restore Database in the upper-right corner.
  5. In the Set Time Restored To step, set the parameters that are described in the following table. Then, click Next.
    Note In this example, backup data is restored to a new instance. If you set the Target database instance type parameter to Use Exists, you must set more parameters. For more information, see the parameter description in Back up an ApsaraDB RDS for MySQL, PolarDB for MySQL, or self-managed MySQL database.
    Restore a MySQL database
    Section Parameter Description
    N/A Task Name

    The name of the restoration task. DBS 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.

    Set Time Restored To Time Range Available to Restore

    The time range from the point in time when the first full backup set is created to the point in time when the latest full backup set is created. The database can be restored to a point in time within the time range.

    Restore To
    The point in time to which you want to restore the source database. The value must be within the time range that is specified by the Time Range Available to Restore parameter.
    Note
    • If the incremental backup feature is enabled, DBS allows you to restore the data to a point in time from the completion of the first full backup to the completion of the last incremental backup.
    • If the incremental backup feature is disabled, DBS allows you to restore the data to a point in time when a full backup is complete.
    Configure Destination Database Target database instance type Select New(Recommend) or Use Exists.
    Note If you select Use Exists, make sure that the destination database is available when you perform the restore operation.
    Database Location The location of the new instance. In this example, select RDS Instance.
    Instance Region The region in which the new instance is deployed.
    VPC The virtual private cloud (VPC) in which the new instance is deployed.
    Note If no VPC is created in a region, you can specify the system to create a default VPC and a default vSwitch when you create an ApsaraDB RDS instance. For more information, see Default VPC and default vSwitch.
    DB InstanceClass The type of the new instance. Select an instance type from the available instance types that are displayed in the DBS console.
    Note We recommend that you select the same instance type as that of the source instance or an instance type with higher specifications.
    Storage Space(GB) The storage space of the new instance. Select a size from the available storage space sizes that are displayed in the DBS console.
    Note To ensure that you have enough space for restoration, we recommend that you reserve at least 1.3 times the size of the source instance or five to six times the size of the DBS full backup set. Data is compressed when DBS performs backup.
  6. In the Configure Objects to Restore step, set the parameters that are described in the following table. Then, click Precheck in the lower-right corner.
    Parameter Description
    Conflict Handling Select one of the following methods for conflict handling:
    • Fail When Object with the Same Name Exists
    • Rename Object with the Same Name. If you select this option, DBS renames the new table that is to be created by the restore task. For example, a table to be restored in the source database and an existing table in the destination database have the same name job_info. DBS renames the new table that is restored from the table in the source database in the following format: job_info_dbs_<ID of the restore task>_</Timestamp>.
    Objects to Restore Select the database or table that you want to restore in the Available section and click the right arrow to add it to the Selected section.
    Note DBS allows you to restore a single database or table. This feature reduces the amount of data to be restored and shortens the recovery time objective (RTO).
  7. After the Precheck Passed message appears in the Precheck dialog box, click Start Task.
    To view the database restoration progress, click Restore Tasks in the left-side navigation pane.
    Note The amount of time used to restore a database depends on the specification of the backup schedule and the size of the database. Higher specifications offer a higher restore speed. For more information, see Performance tests on backup and restoration.
  8. After the Precheck Passed message appears in the Precheck dialog box, click Start Task.
    To view the database restoration progress, click Restore Tasks in the left-side navigation pane.
    Note The amount of time used to restore a database depends on the specification of the backup schedule and the size of the database. Higher specifications offer a higher restore speed. For more information, see Performance tests on backup and restoration.

    If you restore a database to a new ApsaraDB RDS instance, DBS takes about 5 to 10 minutes to create the instance. After the database is restored, you can view the new ApsaraDB RDS instance in the ApsaraDB RDS console. Alternatively, perform the following steps to view the new ApsaraDB RDS instance: On the Restore Tasks page, click the ID of the restore task. On the page that appears, click the ID of the ApsaraDB RDS instance in the Basic Information section. You are navigated to the ApsaraDB RDS console.