Create an on-demand backup of your ApsaraDB for MongoDB instance to protect your data at a specific point in time.
Before you begin
You have a standalone, replica set, or sharded cluster instance.
If your instance runs MongoDB earlier than 4.0 and you plan to use physical backup, verify that the total number of collections and indexes does not exceed 10,000. Physical backups may fail when this limit is exceeded. To avoid this issue, upgrade to MongoDB 4.0 or later. For instructions, see Upgrade the major database version.
After you upgrade the MongoDB version, you cannot use backups created before the upgrade to create new instances.
Considerations
Backup storage location: Backups are stored in Object Storage Service (OSS) and do not consume your instance's storage space.
I/O impact: Snapshot backup uses I/O resources during the backup process.
Hidden node execution: Both logical and physical backups run on a hidden node and do not impact your primary and secondary nodes.
Backup duration: Large datasets may take considerable time to back up.
Custom retention: Only cloud disk instances running MongoDB 4.2 or later support custom retention for manual backups.
Backup deletion: Backup files cannot be deleted manually. The system automatically deletes backups after the configured retention period expires.
Backup methods
ApsaraDB for MongoDB supports three backup methods. The method available to you depends on your instance type and storage configuration.
| Backup method | Mechanism | Availability | Restore speed |
|---|---|---|---|
| Snapshot backup | Captures the exact state of your disk at a specific moment | Standalone instances; replica set and sharded cluster instances on cloud disk with MongoDB 4.2 or later | Fast (typically within minutes) |
| Logical backup | Uses mongodump to record database operations and restores data by replaying them | Replica set and sharded cluster instances on local disk with MongoDB 4.2 or earlier | — |
| Physical backup | Copies raw database files directly | Replica set and sharded cluster instances on local disk with MongoDB 4.2 or earlier | Faster than logical backup |
Costs
ApsaraDB for MongoDB provides a free backup storage quota for each instance. You are charged only for backup storage that exceeds your free quota.
Free quota
| Storage type | Free quota |
|---|---|
| Cloud disk instances | 200% of your purchased storage capacity |
| Local disk instances | 50% of your purchased storage capacity |
You can view your current backup storage usage and free quota on the Basic Information page, under the Specification Information section.
Billing
Backup storage beyond the free quota is billed hourly:
Hourly backup cost = (Total backup storage - Free quota) x Unit price
| Storage type | Region | Unit price (USD per GB-day) |
|---|---|---|
| Cloud disk instances | Regions in the Chinese mainland | 0.0009375 |
| Cloud disk instances | China (Hong Kong) and regions outside China | 0.001125 |
| Local disk instances | Regions in the Chinese mainland | 0.00375 |
| Local disk instances | China (Hong Kong) and regions outside China | 0.0045 |
For detailed pricing information, visit the ApsaraDB for MongoDB Pricing page.
Prices shown are for reference only. Actual billing rates are determined at purchase time and reflected in your bills.
Create a manual backup
Log on to the ApsaraDB for MongoDB console and navigate to your instance:
For replica set instances: click Replica Set Instances.
For sharded cluster instances: click Sharded Cluster Instances.
Select your region and resource group in the upper-left corner, then click your instance ID.
On the Basic Information page, click Back Up Instance in the upper-right corner.
In the Back Up Instance dialog, configure the following settings:
Backup Method: Select your preferred method. The available options depend on your instance type.
Backup Retention Period: Choose how long to keep this backup: | Option | Behavior | |---|---| | Default | Uses the same retention period as automatic backups | | Custom | Set a specific duration between 7 and 730 days | | Permanent | Keeps the backup for the lifetime of the instance |
NoteOnly cloud disk instances running MongoDB 4.2 or later support custom retention for manual backups.
Click OK.
The backup begins immediately. To view the backup, refresh the page and go to the Backup and Restoration tab.
FAQ
How can I view backup storage charges for my instance?
Navigate to the Bill Details page and look for the Backup Storage Size billable item.
Can I manually delete backup files to reduce costs?
No. Backup files cannot be deleted manually. The system automatically deletes backups after they exceed the configured retention period. To reduce backup storage costs, adjust your backup policy by reducing the backup frequency or shortening the retention period. For instructions, see Procedure.
Related API operations
| API operation | Description |
|---|---|
| CreateBackup | Creates a manual backup of your instance. |