This topic describes how to restore a PolarDB for MySQL database by using Database Backup (DBS).

Prerequisites

The database is backed up. For more information, see Back up a PolarDB for MySQL instance.

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. On the Set Time Restored To page, configure the following parameters and click Next.
    Restore a PolarDB for 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 makes the task easy to identify. Task names do not need to be unique.

    Set Time Restored To Time Range Available to Restore

    The time range from the time point when the first full backup set is created to the time point 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.

    Configure Destination Database Target database instance type Select Use Exists. In this example, backup data is restored to the source PolarDB for MySQL instance.
    Database Location Select POLARDB Instance.
    Instance Region The region where the destination instance to which you want to restore your database resides.
    Database Type The type of database that you want to restore. Default value: MySQL.
    POLARDB Instance ID The ID of the PolarDB for MySQL instance to which you want to restore your database.
    Database Account

    The username of the account used to connect to the destination database. You must have write permissions on the database.

    Password

    The password of the account used to connect to the database that you want to back up.

  6. On the Configure Objects to Restore page, configure the following parameters and 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 restoration task. For example, assume that a table to be restored in the source database and an existing table in the destination database have the same name job_info. The system renames the new table that is restored from the table in the source database in the following format: job_info_dbs_<ID of the restoration task>_</Timestamp>.
    Objects to Restore The database or table that you want 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.
  7. If the Precheck Passed message appears, click Start Task.
    To view the restoration progress, go to the backup schedule management page and 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. A higher specification indicates a higher restoration speed. For more information, see Backup and recovery performance tests.