All Products
Search
Document Center

PolarDB:ModifyBackupPolicy

Last Updated:Oct 22, 2026

Modifies the automatic backup policy of a PolarDB cluster.

Operation description

Note

You can also modify the automatic backup policy of a PolarDB cluster in the console. For more information, see Backup settings.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

polardb:ModifyBackupPolicy

update

*dbcluster

acs:polardb:{#regionId}:{#accountId}:dbcluster/{#dbclusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The cluster ID.

Note

You can call the DescribeDBClusters operation to query all clusters in a specific region, including their cluster IDs.

pc-bp13wz9586voc****

PreferredBackupTime

string

No

The time period during which automatic backups are performed. The time must be in the hh:mmZ-hh:mmZ format (UTC time) and must be on the hour with a 1-hour interval, such as 14:00Z-15:00Z.

15:00Z-16:00Z

PreferredBackupPeriod

string

No

The backup cycle. Valid values:

  • Monday: Monday

  • Tuesday: Tuesday

  • Wednesday: Wednesday

  • Thursday: Thursday

  • Friday: Friday

  • Saturday: Saturday

  • Sunday: Sunday

Note
    • You must select at least two days. Separate multiple values with commas (,).

    • This parameter is not supported if the region where your PolarDB for MySQL cluster resides supports cross-region backup. For more information about the regions that support cross-region backup, see Overview.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

Monday,Tuesday

DataLevel1BackupRetentionPeriod

string

No

The retention period of level-1 backups. Valid values: 3 to 14. Unit: days.

Note
  • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

3

DataLevel2BackupRetentionPeriod

string

No

The retention epoch of level-2 backups. Valid values:

  • 0: shutdown of the level-2 backup feature.

  • 30 to 7300: the retention epoch of level-2 backups, in days.

  • -1: long-term retention (LTR) of level-2 backups.

Note
    • When a cluster is created, the default value is 0, which indicates the shutdown of the level-2 backup feature.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

0

BackupRetentionPolicyOnClusterDeletion

string

No

Specifies whether to retain backups when a cluster is deleted. Valid values:

  • ALL: long-term retention (LTR) of all backups.

  • LATEST: long-term retention (LTR) of the last backup.

  • NONE: does not retain backup sets.

Note

Default value: NONE.

NONE

BackupFrequency

string

No

The backup frequency. Valid values:

  • Normal (default): standard backup, performed once a day at a scheduled time.

  • 2/24H: high-frequency backup, performed once every 2 hours.

  • 3/24H: high-frequency backup, performed once every 3 hours.

  • 4/24H: high-frequency backup, performed once every 4 hours.

Note
    • After high-frequency backup is enabled, all backups completed within 24 hours are retained. For backups that exceed 24 hours, the system retains only the first backup completed after 00:00 each day and deletes the rest.

    • After high-frequency backup is enabled, all days of the week (Monday to Sunday) are selected by default for the backup epoch PreferredBackupPeriod parameter.

    • This parameter is not supported if the region where your PolarDB for MySQL cluster resides supports the cross-region backup feature. For more information about the regions that support cross-region backup, see Overview.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

Normal

DataLevel1BackupFrequency

string

No

The backup frequency. Valid values:

  • Normal (default): standard backup, performed once a day at a scheduled time

  • 2/24H: high-frequency backup, performed once every 2 hours

  • 3/24H: high-frequency backup, performed once every 3 hours

  • 4/24H: high-frequency backup, performed once every 4 hours

Note
    • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

    • This parameter is not supported if the region where your PolarDB for MySQL cluster resides does not support cross-region backup. For more information about the regions that support cross-region backup, see Overview.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

Normal

DataLevel1BackupTime

string

No

The time period during which automatic backups are performed. The time must be in the hh:mmZ-hh:mmZ format (UTC time) and must be on the hour with a 1-hour interval, such as 14:00Z-15:00Z.

Note
  • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

  • This parameter is not supported if the region where your PolarDB for MySQL cluster resides does not support cross-region backup. For more information about the regions that support cross-region backup, see Overview.

15:00Z-16:00Z

DataLevel1BackupPeriod

string

No

The backup cycle for level-1 backups. Valid values:

  • Monday: Monday

  • Tuesday: Tuesday

  • Wednesday: Wednesday

  • Thursday: Thursday

  • Friday: Friday

  • Saturday: Saturday

  • Sunday: Sunday

Note
    • You must select at least two days. Separate multiple values with commas (,).

    • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

    • This parameter is not supported if the region where your PolarDB for MySQL cluster resides does not support cross-region backup. For more information about the regions that support cross-region backup, see Overview.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

Monday,Tuesday

DataLevel2BackupPeriod

string

No

The backup cycle for level-2 backups. Valid values:

  • Monday: Monday

  • Tuesday: Tuesday

  • Wednesday: Wednesday

  • Thursday: Thursday

  • Friday: Friday

  • Saturday: Saturday

  • Sunday: Sunday

Note
    • You must select at least two days. Separate multiple values with commas (,).

    • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

    • This parameter is not supported if the region where your PolarDB for MySQL cluster resides does not support cross-region backup. For more information about the regions that support cross-region backup, see Overview.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

Monday,Tuesday

DataLevel2BackupAnotherRegionRegion

string

No

The destination region for cross-region backup of level-2 backups. For more information about the regions that support cross-region backup, see Overview.

Note
  • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

cn-hangzhou

DataLevel2BackupAnotherRegionRetentionPeriod

string

No

The retention epoch for cross-region backup of level-2 backups. Valid values:

  • 0: shutdown of the level-2 backup feature.

  • 30 to 7300: the retention epoch of level-2 backups, in days.

  • -1: long-term retention (LTR) of level-2 backups.

Note
    • When a cluster is created, the default value is 0, which indicates the shutdown of the cross-region backup feature for level-2 backups.

    • After advanced backup is enabled, this parameter no longer takes effect. Use the AdvancedDataPolicies parameter instead.

30

BackupPolicyLevel

string

No

The level of the backup policy. Valid values:

  • Normal: standard backup

  • Advanced: advanced backup

Note
    • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

    • You can check the AdvancedPolicyOption parameter in the response of the DescribeBackupPolicy operation to determine whether the cluster supports advanced backup. If the cluster supports advanced backup, you can apply for this feature in Advanced backup settings.

    • After advanced backup is enabled, you cannot roll back to standard backup.

Normal

AdvancedDataPolicies

array<object>

No

The advanced backup policy.

Note
    • This parameter is not supported by PolarDB for PostgreSQL (Compatible with Oracle) and PolarDB for PostgreSQL.

    • This parameter is supported only by clusters whose BackupPolicyLevel is set to Advanced.

object

No

ActionType

string

No

The operation type. Valid values:

  • CREATE: creates a policy

  • UPDATE: updates a policy

  • DELETE: deletes a policy

CREATE

AutoCreated

boolean

No

Specifies whether the backup policy is automatically generated by the system.

Note

This parameter value is automatically generated. You do not need to specify this parameter.

false

BakType

string

No

The backup type. Valid values:

  • F: full backup

Note

This parameter cannot be modified and is fixed to F.

F

DestRegion

string

No

The destination region of the backup policy.

cn-beijing

DestType

string

No

The destination type of the backup policy. Valid values:

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: cross-region backup of level-2 backups

level2

DumpAction

string

No

The method to convert level-1 backups to level-2 backups. Valid values:

  • copy: copy

copy

FilterKey

string

No

The scheduling type. Valid values:

  • dayOfWeek: schedules by week

  • dayOfMonth: schedules by month

  • dayOfYear: schedules by year

  • backupInterval: schedules at a fixed interval

Note

This parameter is required only when FilterType is set to crontab.

dayOfWeek

FilterType

string

No

The filter type of the advanced policy. Valid values:

  • crontab: periodic scheduling

  • event: event-based scheduling

crontab

FilterValue

string

No

The backup cycle.

1,2,3,4,5,6,7

OnlyPreserveOneEachDay

boolean

No

The 24-hour data retention policy. Valid values:

  • true: retains only the first backup set of the day after 24 hours.

  • false: retains all backup sets.

true

OnlyPreserveOneEachHour

boolean

No

The hourly data retention policy. Valid values:

  • true: retains only the earliest backup set of each hour after 1 hour.

  • false: retains all backup sets.

Note

This parameter cannot be modified and is fixed to true.

true

PolicyId

string

No

The ID of the backup policy. You can call the DescribeBackupPolicy operation to query the ID.

71930ac2e9f15e41615e10627c******

RetentionType

string

No

The retention period type of the backup set. Valid values:

  • never: never expires

  • delay: expires after a fixed number of days

delay

RetentionValue

string

No

The number of days for which backups are retained.

7

SrcRegion

string

No

The source region of the backup policy.

cn-shanghai

SrcType

string

No

The source type of the backup policy. Valid values:

  • db: database cluster

  • level1: level-1 backup

  • level2: level-2 backup

  • level2Cross: cross-region backup of level-2 backups

level1

StorageClass

string

No

The storage class used by the advanced backup policy.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

C5A5DF0E-5968-4DC1-882E-AC2FE7******

Examples

Success response

JSON format

{
  "RequestId": "C5A5DF0E-5968-4DC1-882E-AC2FE7******"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidDataLevel1BackupRetentionPeriod.Malformed The specified parameter DataLevel1BackupRetentionPeriod is not valid. The specified DataLevel1BackupRetentionPeriod parameter is invalid.
400 InvalidDataLevel2BackupRetentionPeriod.Malformed The specified parameter DataLevel2BackupRetentionPeriod is not valid. The specified DataLevel2BackupRetentionPeriod parameter is invalid.
400 InvalidBackupRetentionPeriod.Malformed The specified parameter BackupRetentionPeriod is not valid. The specified BackupRetentionPeriod parameter is invalid.
400 InvalidBackupFrequency.Malformed The specified parameter BackupFrequency is not valid. The specified BackupFrequency parameter is invalid.
400 InvalidPreferredBackupPeriod.Malformed The specified parameter PreferredBackupPeriod is not valid. The specified PreferredBackupPeriod parameter is invalid.
400 InvalidDataLevel2BackupPeriod.Malformed The specified parameter DataLevel2BackupPeriod is not valid. The specified DataLevel2BackupPeriod parameter is invalid.
400 InvalidDataLevel1BackupPeriod.Malformed The specified parameter DataLevel1BackupPeriod is not valid. The specified DataLevel1BackupPeriod parameter is invalid.
400 InvalidPreferredBackupTime.Malformed The specified parameter PreferredBackupTime is not valid. The specified PreferredBackupTime parameter is invalid.
400 InvalidDataLevel1BackupTime.Malformed The specified parameter DataLevel1BackupTime is not valid. The specified DataLevel1BackupTime parameter is invalid.
400 InvalidDataLevel1BackupFrequency.Malformed The specified parameter DataLevel1BackupFrequency is not valid. The specified DataLevel1BackupFrequency parameter is invalid.
400 InvalidDataLevel2AnotherRegionRegion.NotFound The specified parameter DataLevel2BackupAnotherRegionRegion does not found. The specified DataLevel2BackupAnotherRegionRegion parameter cannot be found.
400 InvalidDataLevel2AnotherRegionBackupRetentionPeriod.Malformed The specified parameter DataLevel2BackupAnotherRegionRetentionPeriod is not valid. The specified DataLevel2BackupAnotherRegionRetentionPeriod parameter is invalid.
403 IncorrectBackupPolicy Current DB type does not support low frequency backupPolicy operation. Infrequent access backup operations are not supported by the current database type.
404 InvalidDBCluster.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.
404 InvalidDBClusterId.NotFound The DBClusterId provided does not exist in our records. The specified DBClusterId parameter does not exist in the current record.
404 InvalidParam new archiveBackup policy already exists. dumpretention parameter cannot used alone An archive backup policy has been created. The dumpretation parameter cannot be used alone.
404 InvalidDBClusterId.Malformed The specified parameter DBClusterId is not valid. The specified DBClusterId parameter is invalid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.