...

/

Backup and Restore Options

Backup and Restore Options

Learn to back up and restore MongoDB using mongodump and mongorestore to protect data from loss, corruption, or failures.

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 tool to create binary backups of our databases. This tool ...