By default, automatic backup is enabled. PolarDB automatically backs up data based on the specified backup policy. This way, data security is ensured by periodic and scheduled backups. When a cluster is created, PolarDB automatically backs up data once a day. You can configure parameters such as the frequency of automatic backup and the retention period of backup files in the console based on your business requirements.

Note

  • The backup files that are automatically created cannot be deleted. You can configure the retention period of automatic backup files in the Data Backup Retention Period section in the Backup Settings dialog box.
  • If you modify data after snapshots of your cluster are created, the amount of snapshot backups increases. As a result, the backup cost increases. If data is modified during defragmentation, the amount of snapshot backups increases.
    For example, if your database has 100 GB of data and you modify 10 GB of the data after a snapshot is created,
    • you are charged for 100 GB of data storage and 10 GB of snapshot storage.
    • If you choose to retain the snapshots when you delete your database, you are charged for 100 GB of snapshot storage.

Standard backup and enhanced backup

To enable backup at different frequencies, PolarDB supports two types of automatic backup: standard backup and enhanced backup.

Backup Frequency Description
Standard Backup In this mode, the data is automatically backed up only once a day.

You can specify which days of the week to back up data and the time period during which data is backed up.

Note To prevent data loss, perform automatic backup at least two times a week.
Enhanced Backup PolarDB supports enhanced backup. This feature increases backup frequency to speed up data restoration.

In this mode, the system automatically backs up data multiple times in a day. You can configure the system to perform an enhanced backup once every two, three, or four hours based on your business requirements.

After you enable enhanced backup, all backups are retained for 24 hours. When the retention period expires, the backups are automatically deleted. The system permanently retains the first backup that is created after 00:00 each day.

For example, if you specify a backup frequency of every 4 hours at 08:00 on March 1, the system automatically creates the first backup before 12:00 on March 1. Then, the system continues to create a backup every four hours.

If the current time is 16:00 on March 4, the system retains the following backups:
  • The backups created over the past 24 hours (from 16:00 on March 3 to 16:00 on March 4).
  • The backups created from 00:00 to 04:00 on March 3.
  • The backups created from 00:00 to 04:00 on March 2.
  • The backups created from 08:00 to 12:00 on March 1.
1
Then, after four hours (at 20:00 on March 4), the system retains the following backups:
  • The backups created within the last 24 hours (from 20:00 on March 3 to 20:00 on March 4).
  • The backups created from 00:00 to 04:00 on March 3.
  • The backups created from 00:00 to 04:00 on March 2.
  • The backups created from 08:00 to 12:00 on March 1.
2

Configure an automatic backup policy

You can select Standard Backup or Enhanced Backup based on your business requirements. You can specify the storage location and retention period of data backup files generated by automatic backups.

  1. Navigate to the details page of the cluster for which you want to configure backup settings. In the left-side navigation pane, choose Settings and Management > Backup and Restore.
  2. Click the Backup Settings tab.
  3. Click Edit on the right of Backup Settings. In the dialog box that appears, configure the following parameters.
    Parameter Description
    Backup Frequency The frequency of automatic backups. You can select Standard Backup or Enhanced Backup.
    • Standard Backup: If you select this option, you must specify the frequency of automatic backups and the time when automatic backups start.
      Note To prevent data loss, perform automatic backup at least two times a week.
    • Enhanced Backup: If you select this option, you must specify the backup frequency. You can select Last 24 Hours, Every 2 Hours, Last 24 Hours, Every 3 Hours, or Last 24 Hours, Every 4 Hours.
    Data Backup Retention Period The storage location and retention period of the data backup files generated by automatic backups and manual backups.

    You can specify Level-1 Backup or Level-2 Backup as the storage location. For more information, see Data backups.

    • Level-1 Backup: If you select this option, you must specify the retention period for level-1 backups.
      Note
      • By default, level-1 backup is enabled. The default retention period of level-1 backups is 7 days.
      • A backup can be retained for 3 to 14 days.
    • Level-2 Backup: You can enable or disable level-2 backup.
      Note
      • By default, level-2 backup is disabled. If you enable the feature, storage fees are incurred. You can delete backup files to reduce costs. For more information about the pricing of level-2 backup, see Billing rules of backup storage that exceeds the free quota.
      • Level-2 backups can be retained for 30 to 7,300 days.
      • If you want to permanently retain level-2 backups, select Retained Before Cluster Is Deleted. After you select this option, you cannot specify the retention period of level-2 backups.
    Note For information about other parameters, see Backup settings.
  4. After you complete the backup settings, click OK.

Related API operations

Operation Description
CreateBackup Creates a full backup of a specified PolarDB cluster.
DescribeBackups Queries the backup information of a specified PolarDB cluster.
DeleteBackup Deletes the backups of a specified PolarDB cluster.
DescribeBackupPolicy Queries the automatic backup policy of a specified PolarDB cluster.
ModifyBackupPolicy Modifies the automatic backup policy of a specified PolarDB cluster.