Configure automatic backups

更新时间:
复制 MD 格式

ApsaraDB for MongoDB automatically backs up data based on a configurable backup policy. You can set the backup method, schedule, and retention period for an instance.

Prerequisites

An ApsaraDB for MongoDB standalone instance, replica set instance, or sharded cluster instance is created.

Considerations

  • If your instance runs a MongoDB version earlier than 4.0 and has more than 10,000 collections and indexes combined, Physical Backup may fail. Upgrade to MongoDB 4.0 or later to avoid this issue.

    Important

    Backup files generated before the upgrade cannot be used to create new instances.

  • Only replica set instances that run MongoDB 4.4 or later support instant backup.

  • Only replica set instances and sharded cluster instances support log backup.

    Note

    You cannot disable log backup for sharded cluster instances. If you disable log backup, point-in-time recovery becomes unavailable.

  • The log backup retention period cannot exceed the full backup retention period.

  • After you disable log backup, the existing log backup data is deleted and becomes unrecoverable.

Backup methods

ApsaraDB for MongoDB stores backup files in Object Storage Service (OSS). Backups do not consume instance storage.

The following table lists the backup methods for each instance type.

Instance type

Backup method

Description

  • Standalone instance

  • Cloud disk-based replica set instance

  • Cloud disk-based sharded cluster instance

Snapshot Backup

Captures the state of a disk at a specific point in time, enabling database restoration in minutes.

Note

Backup consumes I/O resources of the instance.

  • Local disk-based replica set instance

  • Local disk-based sharded cluster instance

Physical Backup

Backs up the physical database files of an instance.

Note
  • Physical backups run on a hidden node and do not affect primary or secondary node performance.

  • Large datasets may take longer to back up.

Billing

ApsaraDB for MongoDB provides a free backup storage quota covering full and log backups. Backup storage within the quota incurs no charges. Excess usage is billed as: Hourly backup fee = (Backup storage usage - Free quota) × Unit price.

Free quota by storage type:

Storage type

Free quota

Usage and quota

Cloud disk-based

200% of the storage capacity

View backup storage usage and free quota in the Specification Information section on the Basic Information page.

Local disk-based

50% of the storage capacity

Unit prices for excess backup storage:

Storage type

Unit price (CNY/GB/day)

Cloud disk-based

Varies by region:

  • Chinese mainland: 0.006

  • China (Hong Kong) and other regions outside the Chinese mainland: 0.0072

Local disk-based

Varies by region:

  • Chinese mainland: 0.024

  • China (Hong Kong) and other regions outside the Chinese mainland: 0.0288

Full pricing details are available on the ApsaraDB for MongoDB pricing page.

Warning

Prices listed here are for reference only and may change. Check the purchase page and your bills for actual pricing.

Configure automatic backups

  1. Go to the ApsaraDB for MongoDB replica set instances or ApsaraDB for MongoDB sharded cluster instances page. In the top navigation bar, select a resource group and a region. Then, click the ID of the target instance.

  2. In the left-side navigation pane of the instance page, click Backup and Restoration.

  3. Click the Backup Settings tab.

  4. On the Backup Settings tab, click Edit and configure the following parameters.

    Parameter

    Description

    Backup Method

    Select Standard Backup or High-frequency Backup as needed.

    This topic uses Standard Backup as an example. For High-frequency Backup parameters, see High-frequency backup.

    Full Backup Retention Period (Days)

    Number of days to retain full backups. Valid values: 7 to 730.

    Note

    For instances purchased after September 10, 2021, the default is 30 days.

    Backup Within Seconds

    Enable or disable Backup Within Seconds. Disabled by default.

    When enabled, backups complete within seconds.

    Note

    Only replica set instances that run MongoDB 4.4 or later support instant backup.

    Backed Up At

    Backup time window.

    Select an hourly time window. Schedule backups during off-peak hours.

    Note

    Displayed in your local time zone.

    Day of Week

    Days of the week for backups. Default: daily.

    Note

    Back up at least twice a week for data security. Higher frequency reduces data loss and shortens recovery time.

    Log Backup

    Enable or disable Log Backup. Enabled by default.

    • Enabled: Oplogs are uploaded to OSS in real time and count toward backup billing. Enables point-in-time recovery to restore data to a new instance.

      Note
      • Set the log backup retention period. Click the Log Backup tab to view log backup details.

      • Only replica set and sharded cluster instances support log backup.

    • Disabled: No logs are uploaded to OSS and no log backup fees are incurred. Without oplogs, data can only be restored from the nearest full backup. Enable Log Backup for accurate point-in-time recovery.

      Important

      After you disable log backup, the existing log backup data is deleted and becomes unrecoverable.

    Log Backup Retention Period (Days)

    Number of days to retain log backups when Log Backup is enabled. Valid values: 7 to 730. Default: 7.

    Note

    The log backup retention period cannot exceed the full backup retention period.

  5. Click OK.

FAQ

How do I view fees for instance backups?

Go to the Bill Details page in the Alibaba Cloud console. Filter for bills where Billable Items is Backup Storage and Billable Item Code is BackupStorageSize.

How do I manually delete instance backups?

Instance backups cannot be manually deleted. To reduce backup storage, lower the backup frequency or shorten the retention period. Configure automatic backups.

Related APIs

API

Description

DescribeBackupPolicy

Queries the backup policy of an instance.

ModifyBackupPolicy

Modifies the backup policy of an instance.