MongoDB Backup and Recovery
JusDB reviews, builds, and tests MongoDB backup and recovery for replica sets and sharded clusters on your own servers, Kubernetes, and MongoDB Atlas. Our engineers set up snapshot, Percona Backup for MongoDB, Ops Manager, or mongodump backups, size the oplog for point-in-time recovery, and run restore drills that time a real restore.
The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.
- NDA before access
- Read-only by default
- Written scope before work starts
- Tools we work with
- Percona Backup for MongoDB, Ops Manager and Cloud Manager, Atlas Cloud Backup, filesystem snapshots, mongodump and mongorestore
- Recovery paths
- Full cluster restore, oplog point-in-time recovery, single database or collection restore
- Response SLA
- 15 mins for a critical (P1) incident, 24/7, under a support agreement.
The short answer
What MongoDB backup and recovery covers
MongoDB backup and recovery is the set of snapshots or dumps, saved oplog, and procedures that let you rebuild a replica set or sharded cluster after hardware failure, a bad deployment, an accidental drop or deleteMany, corruption, or ransomware. A backup plus the oplog entries written since it is what makes point-in-time recovery possible.
Replica set members are not backups. Secondaries apply the bad deleteMany within seconds, just as they apply good writes. A delayed hidden secondary buys time for some mistakes, but undoing a logical error still needs a backup taken before it and the oplog to roll forward to just before it.
Our work starts with a read-only review: the backup method for each cluster, oplog size and window at peak load, how sharded cluster backups stay consistent with the config servers, where backups are stored and who can delete them, encryption keys, and the date of the last successful restore. The written report ranks the gaps, then our engineers fix the ones you approve and run a restore drill to prove the fix.
Backup methods
Snapshot, agent-based, and logical backups for MongoDB
The right method depends on data size, whether the cluster is sharded, and where it runs. Logical dumps rarely suit large or sharded production clusters on their own.
| Method | What it captures | How it restores | Where it fits |
|---|---|---|---|
| Percona Backup for MongoDB | Logical, physical, and incremental physical backups of replica sets and sharded clusters to object storage or a filesystem, with oplog slices saved continuously for point-in-time recovery. | pbm restore of a full backup, or to a point in time; restores sharded clusters consistently across shards. | Self-managed and Kubernetes clusters (the Percona Operator uses it) that need point-in-time recovery without Ops Manager. |
| Ops Manager and Cloud Manager | Agent-based snapshots plus continuous oplog capture for replica sets and sharded clusters. | Restores a snapshot or a point in time, delivered as files or applied to a target deployment. | MongoDB Enterprise deployments already managed by Ops Manager, or self-managed clusters monitored through Cloud Manager. |
| Atlas Cloud Backup | Snapshots on the policy you set, with optional continuous cloud backup of the oplog for point-in-time restore. | Restores to an Atlas cluster, either the same one or a separate cluster for testing. | Every Atlas cluster, with retention, region copies, and restore tests reviewed rather than left at defaults. |
| Filesystem or volume snapshots | Block-level copy of the data volume (LVM, EBS, persistent disk). Consistent when the journal is on the same volume; otherwise writes are paused with db.fsyncLock(). | New volume from the snapshot, then start mongod and rejoin or rebuild the replica set. | Fast whole-node copies for replica sets; sharded clusters need snapshots coordinated across shards and config servers. |
| mongodump and mongorestore | Logical BSON export of databases or collections. With --oplog on a replica set member, the dump is consistent to one point. | mongorestore with --oplogReplay; indexes are rebuilt during restore, which takes time on large collections. | Small replica sets, single collection restores, and moving data between clusters or versions. |
The saved oplog is what turns any of these into point-in-time recovery. Without it, the best you can restore to is the moment the last backup was taken.
Point-in-time recovery
How MongoDB point-in-time recovery works
Point-in-time recovery (PITR) restores a backup and replays oplog entries up to a chosen timestamp, stopping just before the operation you want to undo.
Step 1
Save the oplog continuously
Atlas continuous cloud backup, Ops Manager, or PBM's oplog slicing save oplog entries off the cluster. The oplog window on each member must cover any gap, so it is sized and monitored at peak write load.
Step 2
Find the stopping point
Query local.oplog.rs for the bad operation (namespace, op type, and time) to get its exact timestamp. The restore stops at the entry just before it.
Step 3
Restore the base backup to a separate cluster
Restore the last backup taken before the target onto isolated infrastructure. For sharded clusters, every shard and the config server replica set restore to the same point.
Step 4
Replay the oplog and check before cutover
Apply oplog entries up to the stopping point, then check counts and key documents with you. Repoint the application, or copy only the damaged collections back with mongodump and mongorestore.
Check the oplog window
// mongosh on each replica set member rs.printReplicationInfo() // configured oplog size: 51200MB // log length start to end: 113040secs (31.4hrs) // oplog first event time: ... // oplog last event time: ...
Manual replay up to a timestamp
# Restore the base dump taken with --oplog
mongorestore --uri="$RESTORE_URI" --oplogReplay /backup/base
# Replay later oplog entries, stopping before the bad drop
mongodump --uri="$SOURCE_URI" -d local -c oplog.rs \
--query='{"ts":{"$gt":{"$timestamp":{"t":1795176000,"i":1}}}}' \
-o /backup/oplog
mv /backup/oplog/local/oplog.rs.bson /backup/replay/oplog.bson
mongorestore --uri="$RESTORE_URI" --oplogReplay \
--oplogLimit=1795185119:1 /backup/replayIllustrative commands with placeholder names and times. Real runbooks are written against your hosts, paths, and retention settings.
Restore testing
A MongoDB backup counts once it has been restored
A backup job reports success when files or snapshots exist. A restore drill rebuilds the cluster on separate infrastructure and checks it, so a short oplog window or missing key is found on a quiet day instead of during an incident.
The backup restores and starts
The snapshot or backup restores, mongod starts cleanly on every node, and the replica set and sharding metadata come up as expected.
The oplog replays to a target
Saved oplog applies from the backup to a chosen timestamp with no gap, which proves the oplog capture covers the whole window.
Data and indexes are sound
validate() runs on key collections, document counts are compared with the source at the same point, every expected index exists, and the application's smoke queries run.
Users, roles, and keys come back
Users and roles in the admin database restore with the data, and KMIP or keyfile access needed for encryption at rest is available on the restore hosts.
Restore time is measured
Each stage (fetch, restore, oplog replay, index builds, checks) is timed, so the restore time you plan around comes from a real run against your agreed RTO.
The runbook is updated
Any step that was missing, wrong, or slow goes back into the written restore runbook your team keeps.
What each restore drill leaves in writing
- Which backup and oplog range were restored, and the target timestamp
- Time taken for each restore stage, compared with the agreed RTO
- Checks run on the restored cluster and their results
- Problems found, fixes made, and runbook changes
What backup reviews find
MongoDB backup gaps we find most often
These come up repeatedly in backup reviews. Most of them leave the backup job green, which is why they survive until someone tries a restore.
An oplog window shorter than the backup gap
A busy day shrinks the oplog window. If it falls below the time between backups, point-in-time recovery has a hole nobody sees until it is needed.
Sharded backups that are not consistent
Dumping each shard separately, or snapshotting shards at different moments without the config servers, gives a backup that cannot restore as one cluster.
Users and roles left out
Dumps of application databases skip the admin database, so a restored cluster has the data but none of the users, roles, or custom privileges.
Encryption keys tied to the failed host
Encrypted storage needs its keyfile or KMIP server to start. If key access exists only from production hosts, the backup cannot be opened elsewhere.
Backups in the same account as production
Backup storage that production credentials can delete does not survive ransomware or a compromised account. Object lock or a separate account with restricted delete rights closes that gap.
Index rebuild time left out of restore plans
mongorestore rebuilds every index after loading data. On large collections that can dominate restore time, and it is rarely measured until a drill.
Managed cloud and self-managed
MongoDB backups on Atlas, Kubernetes, and your own servers
Atlas and Ops Manager take backups for you, but retention, copies outside the platform, and the restore procedure stay your team's decisions.
| Platform | What the platform handles | What stays with your team |
|---|---|---|
| MongoDB Atlas | Cloud backup snapshots and, when turned on, continuous cloud backup for point-in-time restore within the window you set. | Backup policy and retention, snapshot copies to other regions, restore tests into a separate cluster, and any exports kept outside Atlas. |
| Ops Manager and Cloud Manager | Agent-based snapshots and continuous oplog capture for self-managed deployments. | Backup storage sizing, snapshot schedule, blockstore or S3 configuration, and restore drills. |
| Kubernetes operators | The Percona Operator schedules PBM backups to object storage; MongoDB's Enterprise operator uses Ops Manager backups. | Storage credentials and retention, point-in-time settings, and restores into a fresh cluster. |
| Self-managed on VMs or bare metal | Nothing by default. | Everything: tooling, oplog sizing, snapshot coordination for sharded clusters, storage, encryption, monitoring, and restore drills. |
Your team keeps control
- Set business priorities, application requirements, and release plans
- Approve production changes, except routine actions you have pre-approved
- Own your cloud accounts, access policies, and vendor relationships
- Decide when maintenance can happen and how quickly service must recover
- Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (see Terms, section 8)
JusDB handles the agreed work
- Monitor database health, investigate alerts, and involve the right people
- Review query performance, replication, capacity, and backup health
- Carry out approved changes and update the operating instructions they affect
- Report completed work, open risks, and recommended next steps
Ways to work
Where MongoDB backup and recovery work sits
A backup review is a scoped project with a written report. Running backups, restore drills, and incident restores week to week sits inside a remote DBA or support agreement.
When a restore is part of an incident
24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.
Response means an on-call engineer is working the incident, not an automated reply.
For procurement and security
NDA first, read-only by default, and written scope
- Mutual NDA
- Written statement of work
- Named engineers
- Least-privilege access
NDA before access
Signed before any diagnostic access. The scoping call needs no credentials.
Written scope
Covered databases, backup tooling, drill cadence, and recovery targets agreed in writing.
Least-privilege accounts
Named accounts with only the backup and restore privileges the work needs, through your bastion or VPN.
Runbooks you keep
Restore procedures, scripts, and drill records stay with your team.
JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.
Further reading
MongoDB backup and restore guides
Longer write-ups from our engineering blog, plus the cross-engine backup and disaster recovery service.
Guide
MongoDB oplog sizing and the replication window
How to measure the oplog window, size it for peak load, and keep it stable.
Guide
Database backup strategies, RTO, and RPO
How to set recovery targets and pick a backup strategy that can meet them.
FAQ
MongoDB backup and recovery questions
Answers on mongodump, oplog point-in-time recovery, oplog sizing, recovery targets, and MongoDB Atlas backups.
Still have a question?
Ask it on a scoping call. No production access needed.
Book a 30-min scoping call (opens Google Calendar in a new tab)What does MongoDB backup and recovery work with JusDB cover?
It covers how each replica set or sharded cluster is backed up, how the oplog is kept for point-in-time recovery, where backups are stored and who can delete them, how encryption keys are held, and whether a restore has been tested recently. A first engagement is usually a written backup review; ongoing backup checks and restore drills run under a MongoDB remote DBA or support agreement.
Is mongodump a good backup for production MongoDB?
For small replica sets, with --oplog, it can be. mongodump reads every document through the database, so it is slow on large data sets, adds load, and mongorestore has to rebuild every index. MongoDB's documentation points sharded clusters and large deployments toward snapshot-based tools, because mongodump cannot capture one consistent moment across shards. Most production clusters use snapshots, Percona Backup for MongoDB, Ops Manager, or Atlas backups, and keep mongodump for single collections.
How does MongoDB point-in-time recovery work?
You restore a backup taken before the target time, then replay oplog entries written after it up to the moment just before the bad operation. Atlas continuous cloud backup, Ops Manager, and Percona Backup for MongoDB automate this by saving the oplog continuously. Done by hand, it means dumping local.oplog.rs and running mongorestore --oplogReplay with --oplogLimit set to the timestamp to stop at. It only works if the oplog entries for the whole gap were saved.
How big should the oplog be for backups?
Large enough that its window, shown by rs.printReplicationInfo(), comfortably covers the time between backups plus the time a backup or a lagging secondary needs to catch up, measured at your busiest write periods. The window shrinks when write volume rises, so we monitor it rather than set it once. oplogMinRetentionHours can hold entries for a minimum time on MongoDB 4.4 and later.
Do you commit to a fixed RTO or RPO for MongoDB?
No. Restore time and the amount of recent data at risk depend on data size, index count, storage and network throughput, how the oplog is saved, and the kind of failure. We help you set RTO and RPO targets for each cluster, design backups and oplog capture to meet them, and measure real restore times in drills so the targets rest on evidence.
Do you work with MongoDB Atlas backups?
Yes. Atlas takes cloud backup snapshots on the schedule and retention you set, and continuous cloud backup adds point-in-time restore within the window you configure. We review those settings, snapshot copies to other regions, restores into a separate cluster for testing, and exports you keep outside Atlas if your policy needs them.
We need an emergency MongoDB restore. What happens now?
For JusDB support clients, an emergency restore is handled as an incident. 24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. If you are not yet a client, send us the incident details. We review enquiries within 2–4 business hours, Mon–Fri 09:00–18:00 IST. Work starts once scope and access are agreed.
Next step
Talk to a MongoDB engineer about your backups
Tell us which MongoDB versions and platforms you run, how you back them up today, and when you last restored one. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed.
NDA before access · read-only by default · written scope first
Need a different MongoDB service? Browse our complete offerings.