Search⌘ K
AI Features

Backup and Restore Options

Explore the essential MongoDB techniques for backing up and restoring databases. This lesson teaches you to use mongodump to safely save data and mongorestore to recover it, protecting against data loss from hardware failures, software bugs, or accidental deletions. You will understand how to manage backup files, choose restore options thoughtfully, and incorporate these practices into your data workflow.

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 ...