Search⌘ K
AI Features

Backup and Restore Options

Explore how to safeguard your MongoDB data by learning backup and restore techniques. Understand how to use mongodump to create binary backups and mongorestore to recover databases. This lesson helps you implement essential data protection strategies to prevent loss from errors 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 ...