Table of Contents
To back up a MongoDB database, we support the following backup tool:
Backup Tool | Type | Definition |
---|---|---|
mongodump |
Logical | It is a utility for creating a MongoDB backups that allow you to dump the contents of your MongoDB node into a BSON formatted dump file. BSON is a binary variant of JSON and this will not only keep the dump compact but also improves recovery time. |
Full logical backup using mongodump
From Backup Ninja dashboard, go to Schedules → Add Schedule and follow the configuration wizard:
1) Details
- Enter the name of the schedule:
<strong>bkp_mongodump</strong>
- Select a database server and the backup method to use:
<strong>mongodump</strong>
Only installed backup tools on the selected server will be listed.
2) Storages
Where the backup will be stored. Select Add New Storage → Add Local Storage:
- Add a storage name:
<strong>local_storage</strong>
- Specify a local storage directory:
<strong>/backups/</strong>
- And a retention policy:
<strong>Days - 7</strong>
You can also store the backup on a cloud provider using the cloud storage option.
3) Settings
Specify the name pattern to use for the backup files.
%B - YYYY-MM-DD_HHmmss
%D - database name (schema)
%H - server hostname
%I - backup job number
%M - backup method used
You can use compression (Gzip by default) and encryption (AES 256-bit OFB by default). If you enable encryption, a new window with the encryption key will be shown:
You will need the encryption key to restore the backup, so make sure you save the key in a secure place.
4) Schedule
Schedule when the backup will be executed:
Backups will be scheduled to run based on the database servers timezone setting.