Database Backup (DBS) allows you to back up and restore data across Alibaba Cloud accounts for databases that support the logical backup feature of DBS. The databases include ApsaraDB RDS databases, ApsaraDB for Redis databases, ApsaraDB for MongoDB databases, PolarDB databases, and self-managed databases that are connected over Express Connect, VPN Gateway, or Smart Access Gateway. This topic describes how to back up and restore data across Alibaba Cloud accounts by using DBS. In this example, ApsaraDB RDS for MySQL is used.
Prerequisites
The source database and DBS backup schedule belong to different Alibaba Cloud accounts.
A Resource Access Management (RAM) role is created within the Alibaba Cloud account to which the source database belongs and is granted the permissions to access resources within the Alibaba Cloud account. The RAM role is assigned to the Alibaba Cloud account to which the destination database belongs so that this Alibaba Cloud account can use DBS to access the resources within the Alibaba Cloud account to which the source database belongs. For more information, see Create a RAM role for data backup and restoration across Alibaba Cloud accounts.
Back up data across Alibaba Cloud accounts
Log on to the Database Backup (DBS) console.
If the Note message appears to remind you that no alert rule is configured for DBS, click OK. Then, the default alert rule DBS_EVENT_RULE is automatically configured.
NoteIf the DBS_EVENT_RULE alert rule is configured, the message does not appear after you log on to the DBS console. In this case, you can skip this step. For more information, see Manage alert rules.
In the left-side navigation pane, click Backup Schedules.
On the Backup Schedules page, click Create Schedule in the upper-right corner to purchase a backup schedule for the database that you want to back up.
NoteFor more information about how to create a backup schedule, see Create a backup schedule.
Find the backup schedule that you purchased and click Configure Backup Schedule in the Actions column.
In the Configure Backup Source and Destination step of the Configure Backup Schedule wizard, select an instance category that supports cross-account data backup from the Database Location drop-down list. In this example, RDS Instance is selected.
Click Cross Alicloud instance.
Configure the Cross Alicloud UID and Role name parameters based on your business requirements.
Parameter
Description
Backup Mode
The backup mode that you selected on the buy page. You cannot change the value of this parameter.
Database Location
The instance category of the source database. Cross-account data backup is supported by ApsaraDB RDS databases, ApsaraDB for Redis databases, ApsaraDB for MongoDB databases, PolarDB databases, and self-managed databases that are connected over Express Connect, VPN Gateway, or Smart Access Gateway. In this example, an ApsaraDB RDS for MySQL instance is used.
Instance Region
The region in which the source database resides. The region is selected on the buy page.
Cross Alicloud UID
The ID of the Alibaba Cloud account to which the source database belongs.
NoteYou can log on to the account management console with the Alibaba Cloud account to which the source database belongs and view the account ID on the Overview page.
Role name
The name of the RAM role that you configured. In this example, the role name is ram-for-dbs.
RDS Instance ID
The ID of the ApsaraDB RDS for MySQL instance to which the source database belongs. The drop-down list displays the IDs of the ApsaraDB RDS for MySQL instances that belong to the Alibaba Cloud account specified by the Cross Alicloud UID parameter.
ImportantIf the source or destination database is a self-managed database, you must manually add the CIDR block of DBS servers in the corresponding region to the security settings of the self-managed database to allow access from DBS servers. For more information, see Manually add the CIDR blocks of DBS to the security settings of self-managed databases.
Database Account
The account that is used to log on to the source database.
NoteThe account must have the required permissions on the source database. For more information, see Account permissions.
Password
The password that is used to log on to the source database.
Compliance warranty regarding cross-border data transfers:
Read and agree to the statement of compliance by selecting the check box.
NoteFor more information about the subsequent steps, see Configure a backup schedule.
Restore data across Alibaba Cloud accounts
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 details page of the backup schedule, 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 to be restored shares the same name with a table in the destination database, the system renames the restored table in the following format:job_info_dbs_<Restore task ID>_<Timestamp>
.Objects to Restore
Select the database or table that you want to restore in the Available section and click the rightwards arrow to add it to the Selected section.
NoteDBS allows you to restore some databases by database or table. This reduces the amount of data to be restored and shortens the recovery time objective (RTO). For more information about the supported restoration granularity, see Database engines and features.
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 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. 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.
CIDR blocks of DBS servers
In the preceding configurations, the CIDR block of DBS servers that is used resides in the region where the data center is connected to a VPC on Alibaba Cloud by using an Express Connect circuit. The following table describes the CIDR blocks of DBS servers that are supported in various regions for connections to VPCs over Express Connect.
Region | CIDR block of DBS servers |
China (Hangzhou) | 100.104.217.0/24 |
China (Beijing) | 100.104.119.0/24 |
China (Qingdao) | 100.104.183.0/24 |
China (Shanghai) | 100.104.191.0/24 |
China (Shenzhen) | 100.104.81.0/24 |
China (Chengdu) | 100.104.133.128/26 |
China (Ulanqab) | 100.104.76.192/26 |
China (Heyuan) | 100.104.127.0/26 |
South Korea (Seoul) | 100.104.150.192/26 |
Thailand (Bangkok) | 100.104.119.128/26 |
China (Hong Kong) | 100.104.10.0/24 |
Singapore | 100.104.10.0/24 |
Japan (Tokyo) | 100.104.144.0/24 |
China (Hohhot) | 100.104.40.0/24 |
China (Zhangjiakou) | 100.104.48.0/24 |
US (Virginia) | 100.104.220.0/24 |
US (Silicon Valley) | 100.104.17.0/24 |
Australia (Sydney) Closing Down | 100.104.234.0/24 |
Germany (Frankfurt) | 100.104.133.0/24 |
Malaysia (Kuala Lumpur) | 100.104.10.0/24 |
Indonesia (Jakarta) | 100.104.209.0/24 |
Related API operations
Operation | Description |
Creates, configures, and starts a backup schedule. | |
Creates a restoration task. | |
Starts a restoration task. | |
Queries a list of restoration tasks. |
FAQ
Q: Can I migrate the backup sets of databases across Alibaba Cloud accounts in the DBS console?
A: No, you cannot migrate the backup sets of databases across Alibaba Cloud accounts in the DBS console.