This topic describes how to back up an ApsaraDB RDS for MySQL instance by using the cross-region backup function. This function automatically replicates the backup files of your RDS instance from the source region to a specified destination region. The backup files in the destination region are used to manage and restore your RDS instance.

Prerequisites

Your RDS instance runs one of the following MySQL versions and RDS editions:
  • MySQL 8.0 High-availability Edition (with local SSDs)
  • MySQL 5.7 High-availability Edition (with local SSDs)
  • MySQL 5.6

Background information

The cross-region backup function is different from the default backup function. For more information about the default backup function, see Back up an ApsaraDB RDS for MySQL instance.

You can use a cross-region backup file of your RDS instance to restore data to a new RDS instance or an existing instance in the destination region. For more information, see Restore the data of an RDS MySQL instance across regions.

Differences between cross-region and default backup

  • The cross-region backup function is disabled by default and must be enabled manually. The default backup function is enabled by default.
  • Cross-region backup files are stored in the destination region. Default backup files are stored in the source region.
  • Cross-region backup files can be restored to a new RDS instance or an existing instance in the source or destination region. Default backup files can be restored to the original RDS instance or a new RDS instance in the source region.
  • Cross-region backup files are independent of your RDS instance. If you release your RDS instance, cross-region backup files will be retained based on the specified retention period, but default backup files will only be retained for seven days.

Billing

The fees for the cross-region backup function include the following two parts:

Precautions

  • Cross-region backup files can be restored to the source or destination region. However, if Transparent Data Encryption (TDE) is enabled, you can only restore them to the source region.
  • Cross-region backups do not affect default backups. Both types of backups can be performed at the same time. Cross-region backups are used to replicate default backup files from the source to destination regions.
  • After a default backup is complete, the system will trigger a cross-region backup to dump the generated default backup file to the destination region.
  • If the cross-region data backup function is enabled and no valid data backup files are generated within 24 hours, the system will trigger a data backup on the secondary instance.
  • If the cross-region log backup function is enabled, the system will check for valid data backup files generated within the last 24 hours.
    • If continuous binary logs are generated following a valid data backup file, the system will dump these binary logs.
    • If no continuous binary logs are generated following a valid data backup file, the system will trigger a data backup on the secondary instance.
  • Cross-region backup is not supported in some regions. The following table lists the regions that support the cross-region backup function.
    Source region Destination region
    China (Hangzhou) China (Shanghai), China (Qingdao), China (Shenzhen)
    China (Shanghai) China (Hangzhou), China (Qingdao), China (Shenzhen)
    China (Qingdao) China (Hangzhou), China (Shanghai), China (Shenzhen)
    China (Beijing) China (Hangzhou), China (Shanghai), China (Qingdao), China (Shenzhen)
    China (Shenzhen) China (Hangzhou), China (Shanghai), China (Qingdao)
    China (Hong Kong) China (Hangzhou), China (Shanghai), China (Qingdao), China (Shenzhen)

Enable cross-region backup for an instance

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. Find the instance. In the Actions column corresponding to the instance, choose More > Cross-region Backup Settings.
    Note
    • You can also click Backup and Restoration in the left-side navigation pane and then click Edit in the upper-left corner of the Cross-region Backup tab.
    • If the Cross-region Backup tab is not displayed, make sure the instance meets the prerequisites.
  4. Configure the following parameters.
    Cross-region backup settings
    Parameter Description
    Cross-region Backup Status Specifies whether to enable cross-region backup. Select Enable.
    Backup Region The destination region to which backup files are stored. The system replicates the backup files generated on the RDS instance to OSS buckets in this region.
    Cross-region Retention Period The retention period of the backup data in days. You can specify an integer from 7 to 1825. Cross-region backup files can be retained for a maximum of five years.
    Note After the RDS instance expires or is released, its cross-region backup files are still retained based on the specified retention period. You can log on to the ApsaraDB for RDS console and navigate to the Cross-region Backup tab of your RDS instance to view the retained cross-region backup files.
    Cross-region Log Backup Status Specifies whether to enable the cross-region log backup function. After you enable this function, the system replicates the binary log files generated on the RDS instance to OSS buckets in the specified destination region.
  5. Click OK.

Enable cross-region backup for multiple instances

  1. Log on to the ApsaraDB for RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. In the left-side navigation pane, click Cross-region Backup.
  4. Select the Pending Instances tab.
  5. Select instances for which you want to enable cross-region backup, and then click Backup Settings.
    Note You can also click Settings corresponding to an instance to enable cross-region backup for a single instance.
    Pending instances
  6. Configure the following parameters.
    Enable cross-region backup for multiple instances
    Parameter Description
    Cross-region Backup Status Specifies whether to enable cross-region backup. Select Enable.
    Backup Region The destination region to which backup files are stored. The system replicates the backup files generated on the RDS instance to OSS buckets in this region.
    Cross-region Retention Period The retention period of the backup data in days. You can specify an integer from 7 to 1825. Cross-region backup files can be retained for a maximum of five years.
    Note After the RDS instance expires or is released, its cross-region backup files are still retained based on the specified retention period. You can log on to the ApsaraDB for RDS console and navigate to the Cross-region Backup tab of your RDS instance to view the retained cross-region backup files.
    Cross-region Log Backup Status Specifies whether to enable the cross-region log backup function. After you enable this function, the system replicates the binary log files generated on the RDS instance to OSS buckets in the specified destination region.
  7. Click OK.

Modify cross-region backup settings

The cross-region backup menu is added to the RDS console. You can modify the cross-region backup settings even if the instance is released.

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Cross-region Backup.
  3. Find the instance and click Settings in the Cross-region Backup Settings column to modify the backup settings.
    Note If the instance is released, you can only modify the retention period.

Disable cross-region backup

To disable the cross-region backup function, follow these steps:

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Cross-region Backup.
  3. Find the target RDS instance, and click Settings in the Cross-region Backup Settings column.
  4. Set Cross-region Backup Status to Disabled and set Cross-region Retention Period to 7 days.
    Note After you disable cross-region backup, no new backup files are generated, but the existing backup files are retained for at least seven days. You must set the cross-region retention period to seven days. After the retention period elapses, all existing backups are deleted and you are no longer charged for them.
  5. Click OK.

View the cross-region backup settings

  1. Log on to the ApsaraDB for RDS console.
  2. In the left-side navigation pane, click Cross-region Backup. Then, you can view the cross-region backup settings of all RDS instances.
    Cross-region backup instances

FAQ

Why am I still incurring charges after I disable the cross-region backup function?

After you disable cross-region backup, it no longer consumes traffic, and your RDS instance no longer generates new backup files. However, you must still pay for the storage space that is occupied by the existing backup files during the specified retention period. The existing backup files are retained for at least seven days. You can set the retention period to seven days. After the retention period elapses, all existing backups are deleted, and you are no longer charged for them.

Related operations

Operation Description
CheckCreateDdrDBInstance Checks whether a cross-region backup file of an ApsaraDB for RDS instance is used for cross-region restoration.
CreateDdrInstance Restores the data of an ApsaraDB for RDS instance to a new instance in a region different from the original instance.
ModifyInstanceCrossBackupPolicy Modifies the cross-region backup settings of an ApsaraDB for RDS instance.
DescribeInstanceCrossBackupPolicy Queries the cross-region backup settings of an ApsaraDB for RDS instance.
DescribeCrossRegionBackups Queries the cross-region data backup files of an ApsaraDB for RDS instance.
DescribeCrossRegionLogBackupFiles Queries the cross-region binary log files of an ApsaraDB for RDS instance.
DescribeAvailableCrossRegion Queries the available destination regions that support cross-region backup from a region.
DescribeAvailableRecoveryTime Queries the time period to which a data backup file can be restored.
DescribeCrossRegionBackupDBInstance Queries the cross-region backup settings of ApsaraDB for RDS instances in a region.