This topic describes how to use Database Backup (DBS) to restore a MySQL database from a physical backup.
Prerequisites
- The database is backed up. For more information, see Back up MySQL databases.
- A server is prepared to receive physical backup files. A backup gateway is installed on the server. For more information, see Add a backup gateway.
Procedure
- Log on to the DBS console.
- In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, select a region in the upper-left corner.
- On the Backup Schedules page, find the ID of your backup schedule 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, set the parameters that are described in the following table. Then, click Next.
Section Parameter Description None Task Name The name of the restoration 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.Note- If the incremental backup feature is enabled, DBS allows you to restore the data to a point in time 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.
Configure Destination Database Instance Region The region in which the destination database is deployed. You can restore the dataset to a server in another region in which a backup gateway is installed. Backup Gateway The backup gateway that is installed to restore data. For more information about how to install a backup gateway, see Add a backup gateway. Note This backup gateway is installed on the destination server.Database Type The type of the database that you want to restore. Default value: MySQL. Destination Directory The directory to which the database is restored. You must set this parameter to a Linux absolute path. Note To ensure that you have enough space for restoration, we recommend that you reserve at least 1.3 times the size of the source database or five to six times the size of the DBS full backup set for the database restoration directory. Data is compressed when DBS performs the backup operation.You can view the size of the full backup set in the DBS console. Log on to the DBS console. In the left-side navigation pane, click Backup Schedules. On the Backup Schedules page, find the backup schedule of the source database and click backup schedule name. In the left-side navigation pane, choose Backup Tasks > Full Data. On the page that appears, you can view the size of the full backup set. For more information, see View backup plans.
- In the Configure Objects to Restore step, set the Restore Mode parameter to Restore Entire Instance and click Precheck in the lower-right corner of the page. Note To restore an Oracle database from a physical backup, you must restore the entire instance.
- After the Precheck Passed message appears in the Precheck dialog box, click Start Task and wait until the database is restored. 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.
- Optional:Start the database.
- Deploy the MySQL database on the server and set the datadir parameter in the my.cnf file to the directory to which data is restored. The my.cnf file is the configuration file of the database.
- Start the database. For example, you can start the database in the Linux operating
system by running the following command:
service mysqld start