How to Backup MongoDB: Complete Guide with Examples
Step-by-step MongoDB backup guide using mongodump, automated scheduling, and best practices for MongoDB Atlas and self-hosted instances with Database Vault.

MongoDB Backup Essentials
MongoDB backups are crucial for data protection. Whether you're using MongoDB Atlas or self-hosted MongoDB, regular backups protect against data loss, corruption, and accidental deletion.
How to Backup MongoDB with Database Vault
Step 1: Get Your MongoDB Connection String
Find your MongoDB connection details:
For MongoDB Atlas:
- Log in to MongoDB Atlas
- Go to your cluster → Connect
- Choose "Connect your application"
- Copy the connection string
For Self-Hosted MongoDB:
- Format:
mongodb://username:password@host:port/database - Or use SRV connection string if available

Step 2: Add MongoDB to Database Vault
Add your MongoDB database to Database Vault:

Step 3: Configure MongoDB Backup Settings
MongoDB backups can be resource-intensive. Configure appropriate intervals:

MongoDB Backup Best Practices
Use Replica Sets for Production
Replica sets provide built-in redundancy and make backups safer by allowing you to backup from secondary nodes.
Backup During Low Activity
Schedule backups during off-peak hours to minimize performance impact.
Test Restore Procedures
Regularly test restoring MongoDB backups to ensure they work correctly.