All Products
Search
Document Center

ApsaraDB for MongoDB:ModifyAdvancedBackupPolicy

Last Updated:Aug 28, 2026

Modifies the advanced backup policy.

Operation description

Geo-redundancy backup applies only to cloud disk replica set instances 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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

DBInstanceId

string

Yes

The instance ID.

dds-2zeb2d64cb46xxxx

PreferredBackupTime

string

No

The time to perform the backup. The time is 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 value).

Standard

BackupRetentionPolicyOnClusterDeletion

integer

Yes

The backup data retention policy.

  • 0: All backup sets of the instance are immediately deleted when the instance is released.

  • 1: The last backup set is retained with long-term retention (LTR) when the instance is released.

  • 2: All backup sets are retained with long-term retention (LTR) when the instance is released.

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 PolicyId is required for other parameters.

CREATE

RetentionType

string

No

The retention period type of the backup set.

  • 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.

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: scheduled by week.

  • dayOfMonth: scheduled by month.

  • dayOfYear: scheduled by year.

  • backupInterval: scheduled at fixed intervals (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.

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: select one of the following values in minutes. For sharded cluster instances, the valid values are 30, 60, 120, 180, 240, 360, 480, and 720. For replica set instances, the 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.

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.

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 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.

1

RetentionType

string

No

The retention period type of the log backup.

  • 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.

  • Geo-redundancy 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.

db

DestRegion

string

No

The region where the geo-redundancy 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.

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 geo-redundancy backup, use UPDATE with EnableLogBackup set to 0.

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.