Chapter 23. Making Backups

It is important to make regular backups of your system. Backups are good protection against most types of failure, and very little can’t be solved by restoring from a clean backup. This chapter covers the common options for making backups:

  • Single-server backups, including snapshot backup and restore procedure

  • Special considerations for backing up replica sets

  • Baking up a sharded cluster

Backups are only useful if you are confident about deploying them in an emergency. Thus, for any backup technique you choose, be sure to practice both making backups and restoring from them until you are comfortable with the restore procedure.

Backup Methods

There are a number of options for backing up clusters in MongoDB. MongoDB Atlas, the official MongoDB cloud service, provides both continuous backups and cloud provider snapshots. Continuous backups take incremental backups of data in your cluster, ensuring your backups are typically just a few seconds behind the operating system. Cloud provider snapshots provide localized backup storage using the snapshot functionality of the cluster’s cloud service provider (e.g., Amazon Web Services, Microsoft Azure, or Google Cloud Platform). The best backup solution for the majority of scenarios is continuous backups.

MongoDB also provides backup capability through Cloud Manager and Ops Manager. Cloud Manager is a hosted backup, monitoring, and automation service for MongoDB. Ops Manager is an on-premise solution that has similar functionality ...

Get MongoDB: The Definitive Guide, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.