This topic describes how to use Database Backup (DBS) to restore a MariaDB database that is backed up by using logical backup. This operation is applicable to scenarios such as restoring data after accidental deletion and analyzing historical data.
Prerequisites
The database that you want to restore is backed up. For more information, see Back up a MariaDB database 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 ID of the backup schedule that you want to use to create a restore task, 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, configure the parameters in the Set Time Restored To and Configure Destination Database sections, and click Next.
Section
Parameter
Description
N/A
Task Name
The name of the 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.
NoteIf incremental log backup is enabled, DBS allows you to restore the data to a point in time within the range 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. For more information, see Enable or disable incremental log backup.
Configure Destination Database
Database Location
The location of the database that you want to back up. In this example, this parameter is set to RDS Instance. Make sure that the destination database is running. DBS also allows you to set the parameter to the following values:
- User-Created Database with Public IP Address <IP Address:Port Number>
- ECS-Hosted Database
- Express Connect DB/VPN Gateway/Intelligent Gateway
- No public network IP: Port's self-built database (accessed through the database gateway)
Note If you select location types other than RDS Instance, you must set other parameters. For more information, see Other parameters.Instance Region
The region in which the destination database to which you want to restore your database resides.
RDS Instance ID
The ID of the destination ApsaraDB RDS instance.
Database Account
The username of the account used to connect to the destination database. The account must have write permissions on the database.
Password
The password of the database account.
Compliance warranty regarding cross-border data transfers
Read and agree to the compliance commitment by selecting the check box.
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.
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.