Back up a Deployment
On this page
You can back up your MongoDB deployment to a local MongoDB database or a cloud-hosted MongoDB database.
Important
Sharded clusters and replica sets are the only deployment types you can back up if your databases run MongoDB FCV 4.2 and earlier. To back up a standalone mongod process running MongoDB FCV 4.2 or earlier, you must convert it to a single-member replica set.
Prerequisites
Unique Names for Deployment Items
Ensure your deployment items have unique names before creating backups.
Important
Replica set, sharded cluster, and shard names within the same project must be unique. Failure to have unique names for the deployments will result in broken backup snapshots.
Replica Set Requirements
A Replica Set must:
Be monitored by Ops Manager.
Run MongoDB Enterprise with an FCV of 4.2 or later.
Have an active primary node.
Have one node with WiredTiger set as its storage engine.
Sharded Cluster Requirements
A Sharded Cluster must:
Be monitored by Ops Manager.
Run MongoDB Enterprise with an FCV of 4.2 or later on all nodes including the config server.
Have an active primary node of each shard and the config server.
Have one node per shard or config server with WiredTiger set as its storage engine.
MongoDB Compatibility
All FCV 4.2 and later databases must fulfill the appropriate backup considerations.
MongoDB Compatibility
The MongoDB version and Ops Manager version must meet the compatibility requirements.
Data Protection Plan
Procedure
You can back up your entire MongoDB deployment.
Set Authentication Mechanisms.
If Automation doesn't manage your deployment and your deployment requires authentication, specify the authentication mechanism and credentials.
Specify the following, as appropriate:
Auth Mechanism | The authentication mechanism that the MongoDB host uses. MongoDB Community options include:
MongoDB Enterprise options also include: |
DB Username | For See Configure MongoDB Agent for Authentication or Configure MongoDB Agent for LDAP. |
DB Password | For |
Allows TLS for connections | If checked, Backup uses TLS to connect to MongoDB. |
You can choose to back up all databases and collections in your MongoDB deployment or specific ones.
In the Start Backup sidebar, configure the backup source and storage engine.
Menu | Possible Values | Default Value |
---|---|---|
Sync source |
|
Using a secondary is preferred because it minimizes performance impact on the primary. |
Storage Engine |
See the considerations in Storage Engines. | Same storage engine as the primary node of the database being backed up. |
If the storage engine is WiredTiger, you can enable encryption. To enable encryption, select Enable Encryption. Select only if you have set up KMIP server for your backups and configured the project to use KMIP.
Set Authentication Mechanisms.
If Automation doesn't manage your deployment and your deployment requires authentication, specify the authentication mechanism and credentials.
Specify the following, as appropriate:
Auth Mechanism | The authentication mechanism that the MongoDB host uses. MongoDB Community options include:
MongoDB Enterprise options also include: |
DB Username | For See Configure MongoDB Agent for Authentication or Configure MongoDB Agent for LDAP. |
DB Password | For |
Allows TLS for connections | If checked, Backup uses TLS to connect to MongoDB. |
To filter which namespaces get backed up, click Advanced Settings.
To exclude databases and collections from this backup:
Click Blacklist.
Enter the first database and collection in the text box. For collections, enter the full namespace:
<database>.<collection>
.To exclude additional databases or collections, click the Add another link then repeat the previous step.
To include only certain databases and collections for this backup:
Click Access List.
Enter the first database and collection in the text box. For collections, enter the full namespace:
<database>.<collection>
.To include additional databases or collections, click the Add another link then repeat the previous step.