MongoDB
Learn how to created automated backups of your MongoDB databases to be stored on Filebase.
Last updated
Was this helpful?
Learn how to created automated backups of your MongoDB databases to be stored on Filebase.
Last updated
Was this helpful?
MongoDB is a cross platform database program that uses JSON-like documents. MongoDB is open source and free to download and self-host on any server.
Read below to learn how to set up automated backups of your MongoDB databases to be stored in a Filebase bucket.
This guide was written using Ubuntu 20.04. Commands and workflow may vary depending on your operating system.
mongodb_backup.sh
.Edit the values to reflect your local configuration.
This script uses the mongodbdump
function to create a backup dump of all MongoDB databases and stores it to a tar file that is then uploaded to Filebase using an AWS CLI command.
It should return the following output:
In your Filebase bucket, you should see the tar file uploaded:
Open your crontab with the following command:
crontab -e
0 8 * * * /path/to/mongodb_backup.sh
Replace the file path with the correct path for your configuration.
This cronjob is scheduled to run every day at 8:00AM on your server. Configure the cronjob values to reflect your desired configuration.
You’ve now configured automated backups for your MongoDB databases!