This topic describes how to use Database Backup (DBS) to restore a PolarDB-X database.

Prerequisites

The database is backed up. For more information, see Back up a PolarDB-X 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. In the Set Time Restored To step, set the parameters that are described in the following table and click Next.
    Section Parameter Description
    N/A Task Name

    The name of the restore 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. You can set this parameter to the time when a full backup set is created.

    Configure Destination Database Database Location The location of the database to which you want to restore the source database. In this example, this parameter is set to Distributed PolarDB-X Instance.
    Instance Region The region where the destination instance to which you want to restore the source database resides.
    Database Type The type of the destination database to which you want to restore the source database. In this example, this parameter is set to Polardb-x (original DRDS upgrade).
    PolarDB-X Instance ID The ID of the destination PolarDB-X instance to which you want to restore the source database. If you restore the source database to the PolarDB-X instance where the source database is deployed, the data in the source PolarDB-X instance may be overwritten. We recommend that you restore the source database to a new PolarDB-X instance.
    Database Name

    The name of the destination database to which you want to restore the source database.

    Database Account

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

    Password

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

  6. In the Configure Objects to Restore step, set the parameters that are described in the following table and click Precheck in the lower-right corner of the page.
    Parameter Description
    Conflict Handling You can select only Fail When Object with the Same Name Exists for Conflict Handling.
    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.
    Note DBS allows you to restore a single table or a single database. This feature reduces the amount of data to be restored and shortens the recovery time objective (RTO).
  7. In the Configure Objects to Restore step, set the parameters that are described in the following table and click Precheck in the lower-right corner of the page.
    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. 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 restore 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.
    Note DBS allows you to restore a single table or a single database. This reduces the amount of data to be restored and shortens the recovery time objective (RTO).
  8. After the Precheck Passed message appears in the Precheck dialog box, click Start Task.
    To view the progress of the restore task, go to the backup schedule management page in the DBS console and click Restore Tasks in the left-side navigation pane.
    Note The amount of time used to restore a database depends on the specifications 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.