Data Disaster Recovery meets various needs for MySQL databases, including geo-redundancy, long-term archiving, and single-table restoration. This topic describes how to use Data Disaster Recovery to back up and restore a MySQL database across different cloud platforms or in a self-hosted environment.
Features
|
Feature |
Description |
|
Incremental backup |
Supports incremental backups by using incremental log streaming to fetch Binlog files in real time. |
|
Full backup |
A logical backup is stored in Parquet format, and a physical backup is stored in gzip format by default. |
|
Download backup files |
You can download backup files. |
|
Geo-redundancy |
You can back up a MySQL database to another region and restore the data to an ApsaraDB for MySQL instance or a self-hosted MySQL database in the source region, destination region, or another region. |
|
Long-term archiving |
Backup sets can be retained for up to 10 years and are automatically transferred to Archive Storage. |
|
Granular backup |
Supports backing up an entire multiple databases, a single database, or a single table. |
|
Single-table restoration |
Supports single-table restoration, which reduces the recovery time by eliminating the need to restore the entire database instance. You can select the target table when you configure the objects to restore. |
Create a backup schedule
For more information, see Create a backup schedule.
-
When you purchase the backup schedule, set Database Type to MySQL and Backup Method to Logical Backup.
-
To learn about the specific granularity for backing up and restoring MySQL databases, see Supported database types and features.
-
Do not perform schema-altering Data Definition Language (DDL) operations during a full backup. This can cause the backup to fail or result in data that cannot be restored.
Configure a backup schedule
-
Log on to the DMS console V5.0.
-
In the top navigation bar, choose .
NoteIf you use the DMS console in simple mode, move the pointer over the
icon in the upper-left corner of the DMS console and choose . -
Find the target backup schedule and click Configure Backup Schedule in the Actions column.
-
On the Configure Backup Source and Destination page, configure the backup source and destination, and then click Next.
Table 1. Database configuration
Section
Parameter
Description
N/A
Schedule Name
Data Disaster Recovery automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not need to be unique.
Backup Source Information
Backup Method
This is automatically set to the backup method you selected when you created the schedule. In this example, the backup method is Logical Backup.
Database Location
Select the location of your source database:
-
No public network IP: Port's self-built database (accessed through the database gateway): Backs up a self-hosted database using a database gateway. You must configure a database gateway for the database instance in advance and select the target Gateway instance ID.
-
User-Created Database with Public IP Address <IP Address:Port Number>: Backs up a self-hosted database over the public network. You must also configure the connection address and port number of the source database instance.
-
ECS-Hosted Database: Backs up a database hosted on an ECS instance. You must also configure the ECS Instance ID and database port number.
-
Express Connect DB/VPN Gateway/Intelligent Gateway: Backs up a self-hosted database using a VPC. You must configure a VPC for the database instance in advance and select the target Peer VPC.
-
PolarDB: Backs up a PolarDB for MySQL cluster. You must also select the source PolarDB Cluster ID.
Instance Region
The region of the source database instance.
NotePolarDB Cluster ID
Select the PolarDB cluster that you want to back up.
Database Type
The default value is MySQL.
NoteThis parameter is displayed only if you select User-Created Database with Public IP Address <IP Address:Port Number>, PolarDB, ECS-Hosted Database, Express Connect DB/VPN Gateway/Intelligent Gateway, or No public network IP: Port's self-built database (accessed through the database gateway).
Peer VPC
Select the VPC.
NoteThis parameter is displayed only when the Database Location parameter is set to Express Connect DB/VPN Gateway/Intelligent Gateway.
ECS Instance ID
Select the ID of the ECS instance to back up.
NoteThis parameter is displayed only when the Database Location parameter is set to ECS-Hosted Database.
Gateway instance ID
Select the database gateway instance.
NoteThis parameter is displayed only when the Database Location parameter is set to Self-managed database without a public IP address and port (accessed via Database Gateway (DG)).
Address
The endpoint of the source database instance.
Note-
If your server has network security settings such as a firewall, you must click Set Whitelist to get the IP addresses of Data Disaster Recovery and add them to your server's whitelist to ensure proper access.
-
This parameter is displayed only when you select No public network IP: Port's self-built database (accessed through the database gateway), Express Connect DB/VPN Gateway/Intelligent Gateway, or User-Created Database with Public IP Address <IP Address:Port Number>.
Port Number
The connection port of the source database.
NoteThis parameter is not displayed when the Database Location parameter is set to ApsaraDB for MongoDB.
Database Account
Enter the database account. This account must have the necessary permissions to back up the database. For more information, see Account permissions.
NoteFor ApsaraDB RDS databases, a read-only account is sufficient for backups, while a read/write account is required for both backups and restores.
Password
Enter the password for the database account.
After you enter the username and password, click Test Connection to the right of the Password field to verify that the database information that you entered is correct. If the source database information is correct, the test is successful. If the test fails, click Diagnose and follow the prompts to adjust the source database information.
SSL Encryption
Select a connection method. The following options are supported:
-
Non-encrypted
-
SSL-encrypted: Secure Sockets Layer (SSL) encrypts network connections at the transport layer to improve the security and integrity of data in transit. However, it also increases network connection response time.
NoteBefore you select SSL-encrypted, enable SSL for your RDS instance. For more information, see Step 1: Enable SSL encryption for an ApsaraDB RDS for MySQL instance.
Compliance warranty regarding cross-border data transfers
Read and agree to the compliance commitment by selecting the check box.
Backup Destination Information
Backup Storage Type
The type of storage for the backup destination. The following options are supported:
-
DBS Storage (recommended): You do not need to create a storage space. Data is automatically stored in the built-in storage, and you are charged based on the amount of data stored. For information about billing, see Billable items of Data Disaster Recovery.
-
OSS For User: You must create an OSS bucket in advance. For more information, see Create a bucket.
Note-
This example uses DBS Storage. If you select OSS For User, you must also configure the OSS Bucket Name parameter. Only OSS Standard storage is supported.
-
If you have a large amount of data, we recommend that you purchase a subscription storage plan to offset the fees for DBS Storage. Storage plans are more cost-effective than pay-as-you-go.
Storage Encryption
Select a storage method. The following options are supported:
-
Encrypted (recommended): Uses the industry-standard AES-256 algorithm for encrypted storage.
When using Object Storage Service (OSS), objects are automatically encrypted upon upload and decrypted upon download.
-
Non-encrypted: Encryption is not enabled.
-
-
On the Edit Backup Objects page, move the databases or tables to be backed up to the Selected box, and then click Next.
Note-
You can back up a single table, a single database, or multiple databases. You can click Select All in the lower-left corner to select all existing databases. The supported backup objects vary by database. For more information, see Supported database types and features.
-
By default, new databases created after the backup task starts are not backed up. To back up a new database, you must add it to the backup plan configuration. For more information, see Modify backup objects.
-
-
On the Configure Backup Time page, configure the backup time and other settings, and then click Next.
Parameter
Description
Full Backup Frequency
Select Periodic Backup or Single Backup as needed.
NoteIf you select Periodic Backup, you must also configure Full Backup Recurrence and Start At.
Full Backup Recurrence
Select the days of the week for the backup. You must select at least one day.
Start At
Select the backup start time, for example, 01:00. We recommend scheduling backups during off-peak hours.
NoteIf the previous full backup task is still in progress at the specified start time, the current backup will be skipped.
Incremental Backup
Select whether to enable incremental backup.
NoteBefore you enable this parameter, ensure that Binlog is enabled for the source database. Binlog is enabled by default for ApsaraDB RDS for MySQL, but must be manually enabled for self-hosted databases.
This parameter is displayed only when the Full-scale Backup Frequency parameter is set to Periodic Backup.
Maximum Concurrent Threads for Full Backup
Enter the maximum number of concurrent threads for a full backup. You can adjust this parameter to control the backup speed. For example, lowering the number of backup threads can reduce the impact on the database.
Backup network speed limit
The network bandwidth limit in MB/s. The default value is 0, which means unlimited. You can set any value.
-
On the Edit Lifecycle page, enter the retention period for full backup data in DBS Storage.
If you enabled the Incremental Backup feature in the previous step, you also need to configure the retention period for incremental backup data. For more information about backup data lifecycle, see How do I manage the lifecycle?.
-
After the preceding configurations are complete, click Precheck in the lower-right corner of the page.
-
In the Precheck dialog box, after the precheck passes, click Start Task.
Note-
When the backup schedule's State changes to Running, the configuration is complete.
-
If the backup schedule encounters an exception or error, we recommend that you troubleshoot and fix the issue promptly. For more information, see How do I fix an abnormal backup schedule? If the issue persists after following the recommended solutions, contact us in the customer support group (DingTalk group number: 35585947).
-
Restore data
After backing up your database, you can quickly restore your data to the last available state if it is lost or damaged due to hardware failures, software errors, human error, or natural disasters.
Usage notes
When restoring data to an existing instance, ensure that the database account specified in the restore task configuration has permissions for the destination database. Otherwise, the restore task may fail. For more details, see Account permissions.
Procedure
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.
-
On the Set Time Restored To page, configure the following information, and then click Next.
Section
Parameter
Description
N/A
Task Name
Data Disaster Recovery automatically generates a task name. We recommend that you specify a descriptive name for easy identification. The name does not need to be unique.
Set Time Restored To
Time Range Available to Restore
The system displays the available time range for restoration, which is from the first to the most recent completed full backup set.
Restore To
Select a restore time that is within the Recoverable Time Range.
Note-
If incremental log backup is enabled, you can restore to any point in time after the backup.
-
If incremental log backup is not enabled, you can only restore to the time of a full backup set.
Configure Destination Database
Target database instance type
Select New(Recommend) or Use Exists.
NoteIf you select Use Exists, ensure that the destination database service is running.
Database Location
-
If you select New(Recommend) as the target database, the option is RDS Instance.
-
If you select Use Exists as the target database, you can choose from the following database locations:
-
No public network IP: Port's self-built database (accessed through the database gateway)
-
User-Created Database with Public IP Address <IP Address:Port Number>
-
ECS-Hosted Database
-
RDS Instance
-
Express Connect DB/VPN Gateway/Intelligent Gateway
-
PolarDB
-
Instance Region
Select the region where the destination instance is located.
NoteThis parameter does not appear when Database Location is set to User-Created Database with Public IP Address <IP Address:Port Number>.
VPC
The VPC where the new instance will be located.
NoteIf you have not created a VPC, see Create and manage a VPC.
DB InstanceClass
The instance type of the new instance. The available options depend on the console.
NoteWe recommend that the new instance type is the same as or larger than the source instance type.
Storage Space (GB)
The storage space for the new instance. The available options depend on the console.
NoteBecause backup files are compressed, the required storage for restoration is larger than the backup file size. We recommend that the storage space be at least 1.3 times that of the original instance, or 5 to 6 times the size of the full backup set.
Database Type
The database type is MySQL.
NoteThis parameter is required only if the Database Location parameter is set to No public network IP: Port's self-built database (accessed through the database gateway).
Gateway instance ID
The gateway of the server where the self-hosted database is located. For information on how to install a backup gateway, see Install a backup gateway.
NoteThis parameter is required only when the Database Location parameter is set to No public network IP: Port's self-built database (accessed through the database gateway).
Address
The public connection address of the destination database.
NoteThis parameter is required only when the Database Location parameter is set to No public network IP: Port's self-built database (accessed through the database gateway), User-Created Database with Public IP Address <IP Address:Port Number>, ECS-Hosted Database, or Express Connect DB/VPN Gateway/Intelligent Gateway.
Port Number
The connection port of the destination database.
NoteThis parameter is required only when the Database Location parameter is set to No public network IP: Port's self-built database (accessed through the database gateway) or User-Created Database with Public IP Address <IP Address:Port Number>.
Database Account
Enter the account for the destination instance. This account must have write permissions.
Password
The password of the account that is used to connect to the database that you want to back up.
Compliance warranty regarding cross-border data transfers
Read and select the compliance statement.
-
-
On the Configure Objects to Restore page, configure the following information, and then click Precheck in the lower-right corner.
Parameter
Description
Conflict Handling
The default Conflict Handling is Rename Object with the Same Name. For example, if you restore a table named
job_infoand a table with the same name already exists in the destination, the system renames the restored table tojob_info_dbs_<restore_task_ID>_<timestamp>.Objects to Restore
In the Available section, select the databases or tables to restore and move them to the Selected section.
NoteSome databases support single-table or single-database restoration granularity, which reduces the amount of data to restore and shortens the Recovery Time Objective (RTO). For specific supported restoration granularities, see Supported database types and features.
-
In the Precheck dialog box, after the Precheck Passed message appears, click Start Task.
You can view the database recovery progress on the Restore Tasks tab on the left.
NoteThe restoration time depends on the backup schedule specifications and the size of the database. Higher specifications result in faster restores. For more information, see Performance tests for logical and physical backups.
If you choose to restore to a new instance, it takes about 5 to 10 minutes for the system to create the new RDS instance. After a successful restoration, you can find the new RDS instance in the RDS console. Alternatively, you can click the restore task ID and then click the RDS instance name in the Basic Information area to be automatically redirected to the RDS console.
Related operations
-
To change the backup source or backup objects, or to modify the backup schedule's backup policy (such as the backup time and retention policy), see Manage a backup schedule.
-
To learn about potential future costs of the backup schedule, see Billing FAQ.
-
If you temporarily do not need backups for business purposes, you can pause the backup schedule to save on backup costs. For details, see Pause or restart a backup schedule.