Last Updated: October 12, 2017
·
4.957K
· rshetty

Backup your Rails DB

Backup your rails application database data using this gem. (rails-backup-migrate)

https://github.com/mattconnolly/rails-backup-migrate

Add this to your GemFile and Do a 'bundle install'

gem 'rails-backup-migrate'

or do a

gem install rails-backup-migrate

And to backup your data use

rake site:backup

It creates a .tgz backup of your DB data with schema of your app.

Then to restore to some other Rails Application, move your .tgz file to the directory of your rails app and do

rake site:restore

That's it.

Happy Hacking ....

1 Response
Add your response

if somebody looking for simple solution for backups: https://github.com/kirillshevch/pg_drive_backup

over 1 year ago ·