So I'm deploying my first Rails app built for a customer – 🎉 – to production in couple of days – I'm using Hatch – and I'm not sure what kind of setup/plan I should have for "disater recover" if things go wrong for any reason – I hope nothing will go wrong :)
I'm going to enable db backups so I always have most recent db, should I consider DigitalOcean backup – my understanding that they take a snapshot of the server every night – is that useful?
What would be the fastest way to restore the db incase I need to?
If you know of any good resource so look into that would be awesome as well.
Looking forward to your answers :)
This is a great question Karim! Exciting to get your app in production for a customer! 🍻
So a couple things to consider here:
psql -U <username> -d <dbname> -1 -f <filename>.sqlOnce it's imported, you can check that all the same data is available locally as it was on your server.
That's most of it. You should also setup the Backup config to notify you on slack or email for failed backups to be safe. If anything goes wrong, you'll want to address that right away.
Just a side note: it would be nice if backup config can be done through the UI ;)
Definitely agreed. That's on the todo list but there are a few things that are higher priority at the moment right now. Plus there are SO many configuration options for the backup gem, that it'd be hard to verify they're all correct and test them in the UI.
Sure I understand. Maybe you can start by the minimal amout of configurations like S3, email, and slack, that should do it for most poeple extra configurations then one gotta ssh in to server and configure him/herself.
You said if file uploads are on S3 no need to backup. Does S3 have automatic backups?
I should clarify that. If your uploads are up to S3, any thing that happens to your server won't affect those files (which is good). You can also setup your S3 to back itself up to another bucket, or another service if you wanted.
Join 27,623+ developers who get early access to new screencasts, articles, guides, updates, and more.