All Products
Search
Document Center

ApsaraDB for MongoDB:Manually back up MongoDB data

Last Updated:Dec 04, 2025

This topic describes how to manually back up an ApsaraDB for MongoDB instance.

Prerequisites

A standalone, replica set, or sharded cluster instance is created.

Usage notes

If your ApsaraDB for MongoDB instance runs a version earlier than MongoDB 4.0 and you select Physical Backup as the backup method, the backup may fail if the total number of collections and indexes in the instance exceeds 10,000. Before you perform a physical backup, upgrade your instance to MongoDB 4.0 or a later version. For more information, see Upgrade the major version of an instance.

Important

After you upgrade the database version, backups created before the upgrade cannot be used to create instances.

Description of manual backup

ApsaraDB for MongoDB stores backup files in Object Storage Service (OSS). These backup files do not use the storage space of your MongoDB instance.

The following table describes the backup methods supported by different types of ApsaraDB for MongoDB instances.

Instance type

Backup method

Description

  • Standalone instances

  • Replica set instances that use cloud disks and run MongoDB 4.2 or later

  • Sharded cluster instances that use cloud disks and run MongoDB 4.2 or later

Snapshot Backup

Retains the data status of a disk at a specific point in time. This method can be used to restore data within minutes.

Note

The backup process consumes I/O resources of the ApsaraDB for MongoDB instance.

  • Replica set instances that use local disks and run MongoDB 4.2 or earlier

  • Sharded cluster instances that use local disks and run MongoDB 4.2 or earlier

  • Logical Backup

  • Physical Backup

  • Logical Backup: The mongodump tool is used to store the operation records of a database in a logical backup file. Data is restored by replaying commands.

  • Physical Backup: The physical files of a database in an ApsaraDB for MongoDB instance are backed up. This method provides faster backup and restoration than logical backup.

Note
  • Logical backup and physical backup are performed on the hidden node of an ApsaraDB for MongoDB instance and do not affect the read and write performance of the primary and secondary nodes.

  • If a large amount of data needs to be backed up, logical backup and physical backup may require a long period of time.

Billing rules

ApsaraDB for MongoDB provides free backup quotas. If your backup storage (full backup and log backup) falls within the free quota, you are not charged fees. For the excess backup storage, you are charged backup fees on an hourly basis. The backup fees are calculated based on the following formula: Backup fees per hour = (Backup storage - Free quota) × Unit price for backup files.

The following table describes the billing details.

Storage type

Free quota

View backup storage and free quota

Cloud disk-based instance

The free quota is equal to 200% of the storage that you purchase for your instance.

You can view the backup storage and free quota in the Specification Information section of the Basic Information page of your instance.

Local disk-based instance

The free quota is equal to 50% of the storage that you purchase for your instance.

The following table describes the billing details of the excess backup storage.

Storage type

Unit price of backup (USD per GB-day)

Cloud disk-based instances

The unit price varies in different regions:

  • Regions in the Chinese mainland: 0.0009375

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

Local disk-based instances

The unit price varies in different regions:

  • Regions in the Chinese mainland: 0.00375

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

For more information, go to the Pricing tab of the ApsaraDB for MongoDB product page.

Warning

The unit price of backup is for reference only. The unit price may change when you purchase an instance. The unit price generated in purchase inquiries and bills shall prevail.

Procedure

  1. Go to the Replica Set Instances page or the Sharded Cluster Instances page. In the upper-left corner, select a resource group and a region. Then, click the ID of the target instance.

  2. In the upper-right corner of the Basic Information page, click Back Up Instance.

  3. In the Back Up Instance panel, select a Backup Method.

  4. In the dialog box that appears, select a Backup Retention Period and click OK.

    Note

    Only cloud disk-based instances that run MongoDB 4.2 or later support custom retention policies for manual backups.

    The following retention policies are available:

    • Default: The retention period is the same as that specified in the automatic backup policy.

    • Custom: Specify a custom retention period for the manual backup. Valid values: 7 to 730 days.

    • Permanent: The manual backup is retained for the lifetime of the instance. For example, you can perform a manual backup at the beginning of each week or month and set the retention policy to Never Expire to retain the backup data for a long time.

    image

    After you manually back up the instance, refresh the page. Then, on the Backup and Restoration page, you can view the generated backup file.

FAQ

How do I view the fees incurred for instance backup?

You can view the bills of the Backup Storage Size billable item on the Billing Details tab of the Bill Details page.

How do I manually delete the backup files of my instance?

You cannot manually delete the backup files of your instance. To ensure that the system automatically deletes the backup files, you can modify the backup policy configured for your instance. For example, you can reduce the backup frequency or the backup retention period. For more information, see Procedure.

Related API operations

API operation

Description

CreateBackup

Manually backs up an ApsaraDB for MongoDB instance.