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

Prerequisites

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

Limits

If the engine version of your ApsaraDB for MongoDB instance is earlier than MongoDB 4.0 and the backup method is set to physical backup, physical backups may fail when the total number of collections and indexes in the instance exceeds 10,000. Before you implement a physical backup, upgrade the engine version of your instance to MongoDB 4.0 or later. For more information about how to upgrade the engine version, see Upgrade MongoDB versions.
Notice After the upgrade, instance backup files that were generated before the upgrade cannot be used to create instances.

Background information

ApsaraDB for MongoDB stores backup files in Object Storage Service (OSS) to reduce the storage usage for ApsaraDB for MongoDB instances.

The following table describes the backup methods for ApsaraDB for MongoDB instances of different architectures and engine versions.
Architecture Backup method Description
  • Standalone instances
  • Replica set instances that run MongoDB 5.0 or 4.4
Snapshot backup Snapshot backup retains disk data at a specific point in time and can be used to restore the data within minutes.
Note Snapshot backup occupies the I/O resources of ApsaraDB for MongoDB instances.
  • Replica set instances that run MongoDB 4.2 or earlier
  • Sharded cluster instances
  • Logical backup
  • Physical backup
  • Logical backup: The mongodump tool is used to store operation records of databases in a logical backup file. This method restores data in the form of playback commands during restoration.
  • Physical backup: Physical database files of an ApsaraDB for MongoDB instance are backed up. This method provides faster backup and restoration than logical backup.
Note
  • Logical and physical backups take place in the hidden node of an ApsaraDB for MongoDB instance, and the read and write performance of the primary and secondary nodes is not affected.
  • If the amount of data to be backed up is large and you use logical or physical backup, the backup process requires a long period of time.

Billing

As of September 14, 2022, manual backup is charged in some regions.

ApsaraDB for MongoDB provides free backup quotas. If your backup storage (both full backup and log backup) falls within the free quota, no fees are charged. For excess usage, you are charged based on the following formula: Backup fee per hour = (Backup usage - Free quota) × Fee per backup-hour. The following table describes the details.
Storage type Free quota View the storage usage and free quota
Enhanced SSD (ESSD) The free quota is equal to 200% of the storage capacity that you purchase for your instance. You can view the storage usage and free quota in the Specification Information section of the Basic Information page of the instance.
Local SSD The free quota is equal to 50% of the storage capacity that you purchase for your instance.

For more information about the unit price of ApsaraDB for MongoDB backups, see the Pricing tab on the ApsaraDB for MongoDB product page.

Procedure

  1. Log on to the ApsaraDB for MongoDB console.
  2. In the left-side navigation pane, click Replica Set Instances or Sharded Cluster Instances based on the instance type.
  3. In the upper-left corner of the page, select the resource group and region to which the instance belongs.
  4. Click the ID of an instance, or click More icon in the Actions column corresponding to the instance and select Manage.
  5. In the upper-right corner of the instance details page, click Back up Instance.
  6. In the Back up Instance panel, set Backup Method.
  7. Click OK.

FAQ

Q: How do I view the fees incurred for instance backup?

A: You can perform the following steps to view the fees:
  1. Log on to the ApsaraDB for MongoDB console. In the top navigation bar, choose Expenses > User Center. User center
  2. In the left-side navigation pane, choose Spending Summary > Spending Summary.
  3. Click the Details tab.
  4. Find BackupStorageSize in the Billing Item column. This is the fees incurred for instance backup.

Related API operations

Operation Description
CreateBackup Manually backs up data of an ApsaraDB MongoDB instance.