To avoid data loss caused by system crashes or other problems, TencentDB for MongoDB supports data backup and rollback after system recovery to ensure data integrity.
Backup Types
Automatic backup: Data is automatically backed up as scheduled based on the system's default backup policy (such as default backup interval and mode).
Manual backup: You can run a backup task at any time to meet your business Ops and troubleshooting requirements.
Backup Methods
In MongoDB, backup policies are generally divided into logical backup, physical backup, and snapshot backup.
Note:
General Edition instances support both logical and physical backup.
Cloud Disk Edition instances support physical and snapshot backup, but currently do not support logical backup.
Physical backup : Refers to directly copying the physical files associated with the database to another location. This method backs up the database's underlying storage files, including data files, index files, and log files. It offers fast backup speeds by copying files directly without parsing database contents, resulting in high efficiency for both backup and rollback.
Logical backup : Uses the mongodump tool to store the database's operation logs in a logical backup file for data backup. During recovery, the operation log is replayed to restore the data. This method backs up the logical structure and data of the database, including documents, indexes, collections, and database-level configurations. While slower in speed, it offers strong portability, allowing logical backups to be restored to different database versions. However, it may require more storage space and impact database performance during the backup process.
Snapshot backup : Creates a snapshot at the storage layer for cloud disks, capturing the disk data status at a specific point in time. This method is fast, has minimal impact on database performance, and does not require downtime, allowing data to be easily restored from a snapshot.
Use Limits
A backup can contain up to 7 days of continuous data; that is, you can roll back data to any time point in the last 7 days.
Note
Instance backup doesn't affect your business.
Backup files are stored in COS without using the storage space of TencentDB for MongoDB instances. For more information on COS, see Cloud Object Storage (COS). Note:
During instance creation, an automatic backup will be triggered based on the instance’s default backup policy.
After scaling adjustments or cross-availability zone migrations, a new automatic backup will be triggered.
Version Description
General Edition
General Edition instances support only logical backups for versions 3.2 and 3.6, while physical backups are available starting from version 4.0 and later.
|
Versions 3.2 and 3.6 | Supported backup method: logical backup | Supported backup method: logical backup |
Versions 4.0 and later (4.0, 4.2, 4.4, 5.0, 6.0, 7.0) | Default backup method: logical backup Supported backup methods: logical backup and physical backup | Default backup method: logical backup Supported backup methods: logical backup and physical backup |
Cloud Disk Edition
The Cloud Disk Edition instances support versions 4.0, 4.2, 4.4, and 5.0, and both snapshot backups and physical backups are available.
|
Versions 4.0, 4.2, 4.4, and 5.0 | Default backup method: snapshot backup Supported backup methods: snapshot backup and physical backup | Default backup method: physical backup Supported backup methods: snapshot backup and physical backup |
Billing Overview
Currently, backup is free of charge. We will notify you when billing for the backup space officially starts.
Prerequisites
The TencentDB for MongoDB replica set or sharded cluster instance is in Running status.
Adjusting the automatic backup policy
2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Shard Instance. The directions for replica set instances and sharded instances are similar.
3. Above the Instance List on the right, select the region.
4. In the instance list, find the target instance.
5. Click the target instance ID to enter the Instance Details page.
6. Select the Backup and Rollback > Backup Task List page.
7. Select the Auto-Backup Settings tab and click Edit.
Note:
The diagram below shows Cloud Disk Edition instances, which currently do not support logical backups.
8. Edit Backup Mode and Backup Start Time based on the parameter descriptions in the following table.
|
Data Backup Retention | Data backup files can be retained for 7 days by default. |
Backup Mode | (Optional) Select a backup method, which includes logical backup, physical backup, and snapshot backup. To select a backup policy, see Backup Methods for guidance on selecting a policy that meets your needs. Note: MongoDB General Edition replica set instances on version 3.6 do not support this parameter setting. |
Backup Start Time | The default start time is 10:00 PM–02:00 AM; that is, the system starts the backup task between 10:00 PM and 02:00 AM every day. You can select a different time period to start data backup as needed by your business. The specific start time varies by the specific scheduling of the backup task. |
9. Click Save to save the settings. Future backups will automatically follow the configured backup rules.
Manual Backup
2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Shard Instance. The directions for replica set instances and sharded instances are similar.
3. Above the Instance List on the right, select the region.
4. In the instance list, find the target instance.
5. Click the target instance ID to enter the Instance Details page.
6. In the top-right corner of the Instance Details page, click Manual Backup.
7. (Optional) Select the Backup Mode. TencentDB for MongoDB 3.6 replica set instances don't support this parameter.
8. Add remarks and click OK.
Downloading a backup file
2. In the MongoDB drop-down list on the left sidebar, select Replica Set Instance or Shard Instance. The directions for replica set instances and sharded instances are similar.
3. Above the Instance List on the right, select the region.
4. In the instance list, find the target instance.
5. Click the target instance ID to enter the Instance Details page.
6. Select the Backup and Rollback > Backup Task List page.
7. In the Backup Task List, find the target file and click Download in the Operation column.
8. In the Generate Backup File pop-up window, read the backup note carefully and click Generate File.
9. Select the File Download List tab and view the backup task progress.
10. After the task execution is completed, you can back up the data to your local device and view it as follows:
Over public network: Click Download from Public Network in the Operation column and directly use the browser to download the backup to your local device.
Over private network: Copy the private network address and run a wget
command wget -c 'private network address' -O backup.tar
in a CVM instance to download the backup at a high speed over the private network. For detailed directions on how to log in to CVM, see Customizing Linux CVM Configurations. Related APIs
|
| |
| |
DescribeBackupDownloadTask | |
| |
Was this page helpful?