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 18, 2014

Recommended Posts



Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected