Backup, Clear, And Restore A Postgresql Database For Rails

Posted by Weston Ganger

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

Article Topic:Software Development - Linux

Date:June 19, 2014

Recommended Posts