This topic describes how to use Database Backup (DBS) to restore a Distributed Relational Database Service (DRDS) database.
Prerequisites
The database is backed up. For more information, see Back up a Distributed Relational Database Service (DRDS) instance by using logical backup.
Procedure
Log on to the Database Backup (DBS) console.
In the left-side navigation pane, click Backup Schedules. In the top navigation bar, select a region.
On the Backup Schedules page, find the backup schedule that you want to manage and click Manage in the Actions column.
On the Configure Task page, click Restore Database in the upper-right corner.
- In the Set Time Restored To step of the Create Restore Task wizard, configure the parameters and click Next. The following table describes the parameters.
Section Parameter Description N/A Task Name The name of the restore task. DBS automatically generates a task name. We recommend that you specify a name that can help you identify the task. Task names do not need 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 that you want to back up. Select PolarDB.
Instance Region The region in which the destination instance to which you want to restore the source database resides. Database Type The type of the source database. Select PolarDB for PostgreSQL.
PolarDB 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 Distributed Relational Database Service (DRDS) instance on which the source database is deployed, the data in the source database may be overwritten. We recommend that you restore the source database to a new Distributed Relational Database Service (DRDS) 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 that is used to connect to the database that you want to back up.
- 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 You can select only Fail When Object with the Same Name Exists for the Conflict Handling parameter. 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). In the Configure Objects to Restore step, configure the parameters that are described in the following table and click Precheck.
Parameter or setting
Description
Conflict Handling
By default, Rename Object with the Same Name is selected for the Conflict Handling parameter. For example, if the
job_info
table shares the same name with another table during the restoration, the system renames the new table tojob_info_dbs_<restoration task ID>_</timestamp>
by default.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.
NoteDBS allows you to restore a single database or table. This reduces the amount of data to be restored and shortens the recovery time objective (RTO).
If the Precheck Passed message appears in the Precheck dialog box, click Start Task.
You can click Restore Tasks in the left-side navigation pane to view the database restoration progress.
NoteThe duration of the restoration depends on the specification of the backup schedule and the size of the database. Less time is required for the restoration of a backup schedule with higher specifications. For more information, see Performance tests on backup and restoration.