Skip to content

Instantly share code, notes, and snippets.

@brennovich
Created March 6, 2012 20:31
Show Gist options
  • Save brennovich/1988798 to your computer and use it in GitHub Desktop.
Save brennovich/1988798 to your computer and use it in GitHub Desktop.
Dump and Restore through Rails
bundle

sudo apt-get install mysql-server libmysql-ruby libmysqlclient-dev

rake db:data:dump RAILS_ENV=production -> Dump contents of Rails database to db/data.yml

Edit database.yml and run:

rake db:setup

rake db:data:load RAILS_ENV=production -> Load contents of db/data.yml into the database
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment