Automated DB Backups

Setup a scheduled workflow to backup a Database every 12 hours

Start building, submit solution and get feedback from the community.
2Submit Solutionยท
5 upvotes10 upvotes

The goal of this project is to setup a scheduled workflow to backup a Database every 12 hours and upload the backup to Cloudflare R2 which has a free tier for storage.

Requirements

The pre-requisite for this project is to have a server setup and a database ready to backup. You can use one of the projects did in the other project. Alternatively:

  • Setup a server on Digital Ocean or any other provider
  • Run a MongoDB instance on the server
  • Seed some data to the database

Once you have a server and a database ready, you can proceed to the next step.

Scheduled Backups

You can do this bit either by setting up a cron job on the server or alternatively setup a scheduled workflow in Github Actions that runs every 12 hours and execute the backup from there. Database should be backedup up into a tarball and uploaded to Clouodflare R2.

Hint: You can use the mongodump to dump the database and then use aws cli to upload the file to R2.

Stretch Goal

Write a script to download the latest backup from R2 and restore the database.


Database backups are essential to ensure that you can restore your data in case of a disaster. This project will give you hands on experience on how to setup a scheduled workflow to backup a database and how to restore it from a backup.

Found a mistake? Help us improve.

Actively Maintained

We are always improving our content, adding new resources and adding features to enhance your learning experience.

Join the Community

roadmap.sh is the 7th most starred project on GitHub and is visited by hundreds of thousands of developers every month.

Rank 7th  out of 28M!

296K

GitHub Stars

Star us on GitHub
Help us reach #1

+90k every month

+1M

Registered Users

Register yourself
Commit to your growth

+1.5k every month

28K

Discord Members

Join on Discord
Join the community

Roadmaps Best Practices Guides Videos FAQs YouTube

roadmap.sh by @kamrify

Community created roadmaps, best practices, projects, articles, resources and journeys to help you choose your path and grow in your career.

© roadmap.sh · Terms · Privacy · Advertise ·

ThewNewStack

The top DevOps resource for Kubernetes, cloud-native computing, and large-scale development and deployment.