Database Backup Service (DBS) practice guide

Updated at:
Copy as MD

Common solutions for Database Backup Service (DBS) scenarios including cross-account backup, geo-redundant backup, and disaster recovery.

Configure RAM for cross-account backup and restore

  1. Log on to the Resource Access Management (RAM) console with the Alibaba Cloud account that owns the source database instance.

    Note

    Ensure that the account that owns the source database instance has the AliyunDBSDefaultRole permission.

  2. In the left-side navigation pane, choose Identities > Roles.

  3. Create a RAM role:

    1. Click Create Role. In the Select Trusted Entity step, select Alibaba Cloud Account.

    2. For Select Trusted Alibaba Cloud Account, select Current Alibaba Cloud Account, and then click OK.

    3. In the dialog box that appears, enter a role name, for example, ram-for-dbs, and click OK.

  4. Grant permissions to the role:

    1. On the details page of the role, click the Permissions tab and then click Grant Permission.

    2. In the panel that appears, select System Policy as the authorization scope.

    3. Based on the Database Location, select the required policies.

      • RDS instance: AliyunRDSReadOnlyAccess and AliyunVPCReadOnlyAccess

      • Self-managed database connected over Express Connect, a VPN Gateway, or Smart Access Gateway: AliyunVPCReadOnlyAccess

      • PolarDB: AliyunPolardbFullAccess

    4. Click OK.

  5. Modify the trust policy:

    1. On the role details page, click the Trust policy > Edit trust policy.

    2. On the Edit Trust Policy page, click JSON Editor and enter the following policy.

      Replace <Account ID> with your main account ID.

      {
       "Statement": [
           {
               "Action": "sts:AssumeRole",
               "Effect": "Allow",
               "Principal": {
                   "RAM": [
                       "acs:ram::<Account ID>:root"
                   ],
                   "Service": [
                       "<Account ID>@dbs.aliyuncs.com"
                   ]
               }
           }
       ],
       "Version": "1"
      }
  6. Click Save to complete the RAM authorization.

Cross-account backup and restore

Configure a cross-account backup

  1. Create a backup schedule.

  2. Configure a backup schedule.

    1. In the Database Location section, select an instance that supports the cross-account feature, and then select Cross-Alibaba Cloud account instance.

      In the configuration form, specify the Instance region, RDS instance ID, Database Account, and Password, and then click Test Connection. For Connection Method, select Non-encrypted Connection or SSL Encrypted Connection. At the bottom of the page, select the Data Cross-Border Compliance Commitment checkbox.

    2. In the Cross-Alibaba Cloud Account ID and Role Name fields, enter the required information.

      • Cross-Alibaba Cloud Account ID: The ID of the primary Alibaba Cloud account that owns the source database instance.

      • Role Name: The name of the RAM role that you created in the source account, such as ram-for-dbs. This role must have the required trust policy attached.

      After completing the configuration, click Check Cross-account Role Authorization.

Configure a cross-account restore

Configure a backup schedule and restore data.

Note

You cannot migrate backup sets across Alibaba Cloud accounts in the console.

Cross-account backup over a public endpoint

  1. Create a backup schedule.

  2. Configure a backup schedule.

  3. Set Database Location to User-Created Database with Public IP Address <IP Address:Port Number>.

Note

If the User-Created Database with Public IP Address <IP Address:Port Number> option is unavailable, search for the DingTalk group ID 35585947 or submit a ticket to request access.

Automatically archive backup sets

  1. Use an operations account to create a backup schedule.

  2. Use an operations account to configure the backup schedule.

  3. Use a backup account to install a backup gateway on the backup server.

    Note

    If you do not have a backup server, purchase a server first.

  4. Using your operations account, find the target backup schedule and click Manage in the Actions column. On the Configure Task page, go to the Backup set download section and click Set backup set download rules. In the dialog box that appears, configure the parameters as described in the following table.

    Note

    This button appears only if the source database engine supports backup set downloads and the storage destination is DBS built-in storage.

    Parameter

    Description

    Auto-download status

    Select Enabled.

    Destination Type

    Fixed to the backup gateway server directory.

    Backup gateway

    Select a backup gateway. DBS uses this gateway to connect to your server.

    Important

    This feature is in beta with potential performance bottlenecks. Do not use the same backup gateway for multiple backup schedules.

    Destination Location

    Select a destination type and specify the storage path:

    • Server directory

    • FTP path

    • NAS directory

    • MinIO path

    Full data format

    Uses the system default format. Not configurable.

    Note

    Full and incremental backup set data formats are covered in the feature documentation.

    Incremental data format

    Uses the native format by default. Not configurable.

  5. After completing the configuration, click OK.

  6. Using your operations account, go to the Configure Task page and click Backup set download in the navigation pane to view the download progress.

Modify a backup lifecycle

  1. Log on to Data Management (DMS) 5.0.

  2. In the top navigation bar, choose Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

    Note

    If you use the DMS console in simple mode, move the pointer over the 2023-01-28_15-57-17.png icon in the upper-left corner of the DMS console and choose All Features > Security and disaster recovery (DBS) > Data Disaster Recovery (DBS) > Backup Plan.

  3. In the Actions column of the target backup schedule, click Manage to open the Configure Task page.

  4. In the Lifecycle information section, click Set Lifecycle.

  5. Set the retention period for full or incremental backups, and then click Save.

    Important
    • Retention period: 7–3,650 days. Expired backup sets are automatically deleted and cannot be restored.

    • If incremental backup is not enabled, the console shows only full backup lifecycle settings. Enable or disable incremental log backup.

Set minimum retention policy

Disaster recovery for an ECS-hosted database

  1. Create a backup schedule and set the Backup Method to Logical Backup.

  2. Configure the backup schedule and set Database Location to ECS-hosted database.

Geo-redundant backup for RDS for MySQL

  1. Apply for a public endpoint for the source RDS for MySQL instance.

  2. Create a backup schedule. For a geo-redundant backup, you must purchase a backup schedule in a region that is different from the source region. Set the Backup Method to Logical Backup.

  3. Configure the backup schedule.

Geo-redundant backup for a self-managed database

  1. Create a backup schedule and set the Backup Method to Logical Backup.

  2. When you configure the backup schedule, set Database Location to User-Created Database with Public IP Address <IP Address:Port Number>.

Note

If the User-Created Database with Public IP Address <IP Address:Port Number> option is unavailable, search for the DingTalk group ID 35585947 or submit a ticket to request access.

Back up a private database with DG

  1. Install a backup gateway.

  2. Create a backup schedule and set the backup method to Logical backup.

  3. Configure the backup schedule, and set Database Location to Self-managed database without public IP:Port (through Database Gateway DG).

Back up an on-premises database with Express Connect

  1. Create a backup schedule and set the Backup Method to Logical backup.

  2. Connect your on-premises IDC to Alibaba Cloud using an Express Connect circuit to establish a VPC-to-IDC network connection. Connect an on-premises IDC to a VPC over an Express Connect circuit.

  3. On the client-side access device in your IDC, add a static route pointing to the DBS CIDR block: ip route <DBS CIDR block> {Alibaba Cloud-side interconnect IP}. DBS CIDR blocks are listed in DBS IP address CIDR blocks.

  4. Manage a backup schedule. Set Database Location to Self-managed database connected over Express Connect, a VPN Gateway, or Smart Access Gateway.

Back up a self-managed Redis database

  1. Create a backup schedule and set the Backup Method to Logical backup.

    Note
    • When you purchase the schedule, set Source Database Type to Redis and Logical Backup to Logical backup.

    • Backup and restore granularity for Database Backup Service (DBS) with Redis databases: Supported database engines and features.

  2. Configure the backup schedule and set Database Location to ECS-hosted database.

  3. Restore data to an ApsaraDB for Redis instance.

  4. Switch the backup to an ApsaraDB for Redis instance.

Cloud disaster recovery for a self-managed MySQL

Prerequisites

A complete logical backup is required.

Note
  • Only logical backup schedules are supported. Physical backups do not support database-level or table-level recovery.

  • Logical backups for PolarDB-X support only backups of the entire instance. Therefore, database-level or table-level recovery is not supported.

Backup and restore

Logical backup and restore for cross-cloud or self-managed MySQL databases.

DBS IP address CIDR blocks

Region

CIDR block

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

Germany (Frankfurt)

100.104.133.0/24

Malaysia (Kuala Lumpur)

100.104.10.0/24

Indonesia (Jakarta)

100.104.209.0/24

Finance Cloud server CIDR blocks

Finance Cloud region

CIDR block

China (Hangzhou)

100.104.255.64/26

China (Shenzhen)

100.104.194.128/26

China (Shanghai)

100.104.45.64/26