Backup, Clear, And Restore A Postgresql Database For Rails

Posted by Weston Ganger on June 19, 2014

First Backup your database:

pg_dump dbname > outfile

To clear your database:

dropdb dbname
createdb dbname

To restore database 

psql dbname < infile

Then run your migrations

rake db:migrate RAILS_ENV=development

Posted in Linux and Tagged with postgresql rails 

Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts