Automatic backups are system backups. You can configure automatic backup settings in the console based on your business requirements. The system will automatically and regularly back up data according to the established backup policies to ensure data security. This topic describes how to configure automatic backup settings.

Precautions

  • The backup files that are automatically created by the system cannot be deleted. You can set the retention period of automatic backup files in the Data Backup Retention Period configuration.
  • If you modify data after the snapshots of your cluster are created, the amount of snapshot backups increases. In this case, you are charged for the additional backups. If data is modified during defragmentation, the amount of snapshot backups also increases.
    For example, assume your database has 100 GB of data,
    • If 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

PolarDB supports two types of automatic backup: standard backup and enhanced backup.

Backup Frequency Description
Standard Backup By default, automatic backup is performed one time each day. You can change the time and frequency of automatic backup.
Note To prevent data loss, automatic backup must be performed at least two times a week.
Enhanced Backup PolarDB supports enhanced backup. This feature increases backup frequency to speed up data restoration.

PolarDB allows you to create backups every 2, 3, or 4 hours for the data that is generated over the past 24 hours.

After you enable enhanced backup, all backups are retained for 24 hours. Backups are automatically deleted when the retention period expires. However, 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 within 4 hours from 08:00 to 12:00 on March 1. Then, the system continues to create a backup every 4 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 between 00:00 and 04:00 on March 3.
  • The backups created between 00:00 and 04:00 on March 2.
  • The backups created between 08:00 and 12:00 on March 1.
1
Then, after 4 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 between 00:00 and 04:00 on March 3.
  • The backups created between 00:00 and 04:00 on March 2.
  • The backups created between 08:00 and 12:00 on March 1.
2

Configure automatic backup

  1. Log on to the PolarDB console.
  2. In the upper-left corner of the console, select the region where the cluster is deployed.
  3. Find the cluster and click the cluster ID.
  4. In the left-side navigation pane, choose Settings and Management > Backup and Restore.
  5. Click the Backup Settings tab.
  6. Click Edit on the right of Backup Settings. In the dialog box that appears, configure the following parameters.
    Type Parameter Description
    Back up Data Backup Frequency You can select Standard Backup or Enhanced Backup.
    • Standard Backup: set the backup frequency and start time of automatic backup.
      Note To prevent data loss, standard backup must be performed at least two times a week.
    • Enhanced Backup: set 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 Specify the retention period for Level-1 Backup and Level-2 Backup.
    • Level-1 Backup: set the retention period for level-1 backups.
      Note
      • The default retention period of level-1 backups is 7 days.
      • A backup can be retained for 3 to 14 days.
    • Level-2 Backup: enable or disable the level-2 backup feature.
      Note
      • By default, the level-2 backup feature is disabled. You will be billed for storage if you enable the feature, but you can delete unwanted backups to reduce costs. For more information about the price of level-2 backup services, see Billing rules of data backups that exceed the free quota.
      • Level-2 backups can be retained for 30 to 7,300 days.
      • To retain level-2 backups permanently, select Retained Before Cluster Is Deleted. The retention period parameter becomes unavailable after you select this option.
    Log Backup Log Backups Retained For Specify the retention period of log backups.
    Note
    • The default retention period of a log is 7 days.
    • Log backups can be retained for 3 to 7,300 days.
    • To retain log backups permanently, select Retained Before Cluster Is Deleted. The retention period parameter becomes unavailable after you select this option.
    General When Cluster Is Deleted Specify the backup retention policy that applies when you delete a cluster.
    • Permanently Retain All Backups: retains all backups after you delete a cluster.
    • Permanently Retain Last Automatic Backup: retains the latest backup after you delete a cluster.
    • Immediately Delete All Backups: does not retain backups after you delete a cluster.
    Note
    • If you select the Permanently Retain All Backups or Permanently Retain Last Automatic Backup policy, the system runs an automatic backup task to retain all the data when you delete the PolarDB cluster.
    • After you delete a cluster, level-1 backups are automatically transferred to level-2 backups. You can go to the Cluster Recycle page to view all backups. For more information, see Restore a released cluster.
  7. After you complete the backup settings, click OK.

Related API operations

API Description
CreateBackup Creates a full backup for 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.