All Products
Search
Document Center

ApsaraDB for MongoDB:ModifyAdvancedBackupPolicy

Last Updated:Sep 23, 2026

Modifies the advanced backup policy.

Operation description

Geo-redundancy backup applies only to cloud disk replica set and cloud disk sharded cluster instances.

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

dds:ModifyAdvancedBackupPolicy

update

*Instance

acs:dds:{#regionId}:{#accountId}:dbinstance/{#dbinstanceId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

dds-2zeb2d64cb46xxxx

PreferredBackupTime

string

No

The time to perform the backup. Specify the time in the HH:mmZ-HH:mmZ format (UTC).

Note

The time range is limited to 1 hour.

09:00Z-10:00Z

SnapshotBackupType

string

No

The snapshot backup type. Valid values:

  • Flash: Backup within seconds.

  • Standard: Standard backup (default).

Valid values:

  • Standard :

    Standard backup (default)

  • Flash :

    Backup within seconds.

Standard

BackupRetentionPolicyOnClusterDeletion

integer

Yes

The backup data retention policy.

  • 0: Deletes all backup sets immediately when the instance is released.

  • 1: Applies long-term retention (LTR) to the last backup set when the instance is released.

  • 2: Applies long-term retention (LTR) to all backup sets when the instance is released.

Valid values:

  • 0 :

    Deletes all backup sets immediately.

  • 1 :

    Applies long-term retention (LTR) to the last backup set.

  • 2 :

    Applies long-term retention (LTR) to all backup sets.

0

AdvancedBackupDataPolicies

array<object>

No

The list of backup policies.

object

No

PolicyId

string

No

The backup policy ID.

Important This parameter is required when ActionType is not set to CREATE.

xxxxxx

ActionType

string

Yes

The action type. Valid values:

  • CREATE: Create.

  • UPDATE: Update.

  • DELETE: Delete. In this case, only the PolicyId parameter is required.

Valid values:

  • DELETE :

    Delete.

  • CREATE :

    Create.

  • UPDATE :

    Update.

CREATE

RetentionType

string

No

The retention epoch type for backup sets.

  • never: Long-term retention (LTR).

  • delay: Retention for a fixed number of days.
    Important This parameter is required when ActionType is not set to DELETE.

Valid values:

  • never :

    Long-term retention (LTR).

  • delay :

    Retention for a fixed number of days.

delay

RetentionPeriod

integer

No

The number of days to retain the backup plan.

  • Same-region backup: 7 to 7300 days.

  • Geo-redundancy backup: 3 to 1825 days.
    Important This parameter is required when RetentionType is set to delay.

7

BackupPolicy

string

No

The scheduling type of the advanced policy. Valid values:

  • dayOfWeek: weekly scheduling.

  • dayOfMonth: monthly scheduling.

  • dayOfYear: yearly scheduling.

  • backupInterval: fixed-interval scheduling (high-frequency backup).

Note
  • Multiple high-frequency backup policies are not supported.

  • Multiple geo-redundancy backup policies are not supported, and geo-redundancy backup policies support only dayOfWeek.

Important This parameter is required when ActionType is not set to DELETE.

Valid values:

  • dayOfWeek :

    Weekly scheduling.

  • dayOfMonth :

    Monthly scheduling.

  • dayOfYear :

    Yearly scheduling.

  • backupInterval :

    Fixed-interval scheduling (high-frequency backup)

dayOfWeek

PreferredBackupPeriod

string

No

The backup cycle.

  • If BackupPolicy is set to dayOfWeek: 1,2,3,4,5,6,7 indicates Monday through Sunday. At least 2 backups per week are required.

  • If BackupPolicy is set to dayOfMonth: 1,3,-1 indicates the 1st, 3rd, and last day of each month. -1 indicates the last day of each month.

  • If BackupPolicy is set to dayOfYear: 01-07 indicates January 7. Only one day can be selected.

  • If BackupPolicy is set to backupInterval: specify one of the following values in minutes. For sharded cluster instances, valid values are 30, 60, 120, 180, 240, 360, 480, and 720. For replica set instances, valid values are 15, 30, 60, 120, 180, 240, 360, 480, and 720.

Important This parameter is required when ActionType is not set to DELETE. Geo-redundancy backup policies support only dayOfWeek.

1,4,6

SrcRegion

string

No

The region where the instance resides.

Important This parameter is required when ActionType is not set to DELETE.

cn-guangzhou

SrcType

string

No

The source type of the backup policy.

  • db: same-region backup.

  • level1: cross-region backup.
    Important This parameter is required when ActionType is not set to DELETE.

Valid values:

  • level1 :

    Cross-region backup.

  • db :

    Same-region backup.

db

DestRegion

string

No

The destination region of the backup policy.

Important This parameter is required when ActionType is not set to DELETE.

cn-guangzhou

DestType

string

No

The destination type of the backup policy.

  • level1: same-region backup.

  • level2Cross: cross-region backup.
    Important This parameter is required when ActionType is not set to DELETE.

Valid values:

  • level1 :

    Same-region backup.

  • level2Cross :

    Cross-region backup.

level1

PreserveOneEachHour

boolean

No

Specifies whether to enable hourly sparse backup.

  • true: When the backup frequency is at the minute level, all snapshots within 1 hour from the current time are retained. For snapshots that are more than 1 hour but within 24 hours from the current time, only the first snapshot after each full hour is retained.

  • false: All snapshots within the high-frequency backup retention period are retained.

False

AdvancedBackupLogPolicies

array<object>

No

The list of log backup policies.

object

No

EnableLogBackup

integer

Yes

Specifies whether to enable log backup.

  • 1: Enabled.

  • 0: Disabled.

Note
  • Log backup must be enabled for sharded cluster instances.

  • Cross-region log backup requires same-region log backup to be enabled first.

Valid values:

  • 0 :

    Disabled.

  • 1 :

    Enabled.

1

RetentionType

string

No

The retention epoch type for log backups.

  • never: Long-term retention (LTR).

  • delay: Retention for a fixed number of days.

Valid values:

  • never :

    Long-term retention (LTR).

  • delay :

    Retention for a fixed number of days.

delay

RetentionPeriod

integer

No

The number of days to retain log backups. This parameter takes effect when RetentionType is set to delay.

  • Same-region backup: 7 to 7300 days.

  • Cross-region backup: 3 to 1825 days. The value must be less than the backup retention period of the geo-redundancy backup policy.

7

SrcRegion

string

No

The region where the source instance resides.

cn-hangzhou

SrcType

string

No

The source type of the log backup policy.

  • db: same-region backup.

  • level1: cross-region backup.

Valid values:

  • level1 :

    Cross-region backup.

  • db :

    Same-region backup.

db

DestRegion

string

No

The region where the cross-region log backup resides.

Note

This parameter is required for geo-redundancy backup.

cn-huhehaote

DestType

string

No

The destination type of the log backup policy.

  • level1: same-region backup.

  • level2Cross: cross-region backup.

Valid values:

  • level1 :

    Same-region backup.

  • level2Cross :

    Cross-region backup.

level1

PolicyId

string

No

The log backup policy ID. This parameter exists only for cross-region log backup policies and is required.

xxxx

ActionType

string

Yes

The action type.

  • CREATE: Create.

  • UPDATE: Update.
    Important This parameter applies only to geo-redundancy backup. To delete a geo-redundancy backup, use UPDATE and set EnableLogBackup to 0.

Valid values:

  • CREATE :

    Create.

  • UPDATE :

    Update.

CREATE

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

2F42BB4E-461F-5B55-A37C-53B1141C****

Examples

Success response

JSON format

{
  "RequestId": "2F42BB4E-461F-5B55-A37C-53B1141C****"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidPreferredBackupPeriod.Malformed Specified parameter PreferredBackupPeriod is not valid.
400 InvalidPreferredBackupTime.Malformed Specified parameter PreferredBackupTime is not valid.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.