Search⌘ K
AI Features

Backup and Restore Options

Understand the importance of backing up MongoDB databases to protect against accidental deletions, hardware failures, and security incidents. Learn how to use mongodump for creating binary backups and mongorestore to recover data safely, including options for replacing or merging existing data.

Why do we backup and restore data?

A backup is a saved copy of the database at a certain point in time. It protects from accidental deletions or overwrites, and avoids corrupted data due to software bugs, hardware failures (e.g., disk crash), and security incidents (e.g., ransomware). Without backups, we risk losing all our hard work permanently.

​​A restore brings the database back to a previous working state using the backup files. It's like clicking “Undo” on the entire database.

Backing up a MongoDB database

MongoDB provides the mongodump ...