Hourly Production Server Database And File Backups Discussion
Thank you for this! I should get this up and running on a site I run for a complex fantasy football league...I've been meaning to with Cron jobs and whatnot, but it's just such a hassle and, so far, there hasn't been much site traffic, but still...a catastrophe could be hiding around an upcoming corner!
s3.path = "/production/database"
Is the the end point or path with the bucket? I get The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.
Does one need to set any permission on the bucket?
For anyone getting this warning.
[fog][WARNING] fog: the specified s3 bucket name(BUCKET_NAME) is not a valid dns name, which will negatively impact performance.
Fog does not like dash in the the BUCKET_NAME. It's best to use BUCKETNAME.
Thanks Chris for this very useful guide. I just implemented the Backup gem and the cron job. And it is successfully storing a backup of the database to Amazon S3.
At the end of the guide you say:
"Always be sure to test your backups and make sure you can safely restore from them!"
So how do you restore your database with a backup on Amazon S3?
greetings,
Anthony
Depends on what you're backing up, but for example, you can restore a mysql database with a sql file like this: http://stackoverflow.com/a/...
Hello Chris, thanks for this useful website! I am getting the following error with Amazon S3: AuthorizationHeaderMalformed
<message>The authorization header is malformed; the authorization header requires three components: Credential, SignedHeaders, and Signature.</message>
I have tried to use GIYF without success. I have paperclip gem in my rails app working fine with the same S3 credentials and same bucket but backup gem is not! Can you help me please?
[fog][WARNING] fog: followed redirect to my-bucket.s3-eu-west-1.amaz..., connecting to the matching region will be more performant
[info] CloudIO::Error: Retry #1 of 10
[info] Operation: PUT 'path/production_backup.tar'
[info] --- Wrapped Exception ---
[info] Excon::Errors::BadRequest: Expected(200) <=> Actual(400 Bad Request)
[info] excon.error.response
[info] :body=> "\n<error>IncompleteBody
<message>The request body terminated unexpectedly<
Any Idea?
Hi Chris, my application db size is 84 GB. If the backup runs every one hour will it not hamper the application. What should be the ideal way?
Lots of options. Depending on how long it takes you might want to do this every 4 hours or something instead. You might want to do a live replica database for realtime backups to another server and then archive a copy of it nightly.
You should use database replicas and make partial and transaction backups. I did that on MS SQL server but i don't know how that would be achieved on Postgres or Mysql.
Hey Chris this is interesting. But I need the restore functionality. Do you think you have a way arounf?
You've just got to download the backup, extract it, and reimport your database and do the same for whatever else you may have backed up.
Hey Chris! Are you still using this method in production? I haven't been able to get the backup gem to work with ruby 2.4.x, have you gotten it to work with rails 5.1 and a recent ruby?
Hey Chris, how to do a incremental backup. Is there best tools to do that or procedure to do with postgres commands like WAL to get incremental backup.
The Backup gem is in "maintenance-only" phase now. Is there a newer suggested gem to replace this functionality with Rails projects?