This topic describes how to configure automatic backup for an ApsaraDB for MongoDB instance. ApsaraDB for MongoDB can automatically back up data based on the default backup policy or the backup policy you specify.
- If the database version of the instance is 3.2 or 3.4, the number of collections and indexes in the instance cannot exceed 10,000. Otherwise, physical backup may fail. If your business may exceed this limit, we recommend that you Upgrade the database version of an ApsaraDB for MongoDB instanceto 4.0, you can also select the database version 4.0 or 4.2 when creating the instance.
- After the database version is upgraded, the backup files of the original version cannot be used to restore data of the new version.
- ApsaraDB for MongoDB stores backup files in Object Storage Service (OSS) to reduce the storage space usage of ApsaraDB for MongoDB instances.
- Standalone instances can only use snapshot backup, which affects their I/O performance
in the backup process.
Note Snapshot backup retains the status of disk data at a specific point in time.
- Replica set and sharded cluster instances support physical backup.
Note With physical backup, all physical database files in an ApsaraDB for MongoDB instance are backed up. Physical backup runs on the hidden node of an ApsaraDB for MongoDB instance, and does not affect the I/O performance of the primary and secondary nodes. Backing up a large volume of data may take a long time.
- Log on to the ApsaraDB for MongoDB console.
- In the upper-left corner of the page, select the region where the target instance resides.
- In the left-side navigation pane, click Replica Set Instances or Sharding Instances.
- Find the target instance and click its ID.
- In the left-side navigation pane, click Backup and Recovery.
- Click Backup Settings.
- In the dialog box that appears, configure the following parameters as needed.
Parameter Description Retention Days The number of days for which you want to retain backup data. It can only be seven days. Backup Time The hour at which you want to perform the backup task. We recommend that you select an off-peak hour. Day of Week The backup cycle. You can select one or more than one day in a week.
- Click OK.