Database Backup (DBS) allows you to restore data from backups to cloud databases, on-premises databases, or DBS sandbox instances by creating restore tasks. You can use this feature to restore a database after an accidental operation and analyze historical data.
Prerequisites
Your DBS backup schedule is in the Running state.
The database that you want to restore is backed up. For more information, see Back up databases or Configure a backup schedule.
Billing
The restoration feature is available free of charge. However, if you restore a database to a new ApsaraDB RDS instance, you are charged for the new instance. The new instance fees are related to the selected instance type and storage space. The actual fees on your bills prevail.
Usage notes
If you use a DBS backup schedule that is created in a region to restore a database to an ApsaraDB RDS instance in another region, make sure that the destination ApsaraDB RDS instance is accessible over a public endpoint.
For example, if a DBS backup schedule is created in the China (Hangzhou) region and you want to use the DBS backup schedule to restore data to an ApsaraDB RDS instance in the China (Beijing) region, make sure that the ApsaraDB RDS instance in the China (Beijing) region is accessible over a public endpoint.
The restoration duration depends on the specifications of the backup schedule and the size of the database to be restored. The restoration duration is shorter for a backup schedule with higher specifications. The restoration duration is longer if the database to be restored is larger. For more information, see Performance tests on backup and restoration.
Procedure
This example describes only a general procedure for restoring databases. The specific restoration procedure varies based on database engines. For more information about the backup and restoration scenarios for different database engines, see Backup and restoration overview.
DBS also provides the sandbox feature based on the copy data management (CDM) technology. This feature allows you to restore databases with a recovery time objective (RTO) of several seconds. You can analyze, test, and verify data in a sandbox instance. For more information, see Restore a self-managed MySQL database in an emergency.
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 use 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 in the Set Time Restored To and Configure Destination Database sections. Then, click Next in the lower-right corner of the page.
NoteThe specific restoration procedure varies based on database engines. For more information about the backup and restoration scenarios for different database engines, see Backup and restoration overview.
DBS allows you to restore a database such as a MySQL or SQL Server database to a new ApsaraDB RDS instance without the need to create the instance in advance.
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).
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.
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.
If you restore a database to a new ApsaraDB RDS instance, DBS needs 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 operations 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.
Related operations
You can also directly create, start, or view a restoration task by calling an API operation. For more information, see CreateRestoreTask, StartRestoreTask, or DescribeRestoreTaskList.
If the backup data at the specified point in time does not meet your business requirements, you can click Start Full Data Backup in the upper-right corner of the Full Data page to manually back up the database. After the backup is complete, configure a restoration task to restore the database to the point in time of the latest full backup.
If an exception or error occurs in the restoration task, refer to Common Errors and Troubleshooting for troubleshooting.