Restore a Postgres Database from Your VPS to Heroku

If your fledgling app isn’t gaining much traction and you don’t want to pay monthly fees for hosting a vps and you don’t want to see all the hours you pured into your app to disappear, why not move it over to heroku for free?

One caviet from using pg_dump that heroku doesn’t tell you is that heroku uses the custom format so if you try to import a regular dump in plain text format, the restore process in heroku will fail.

So do the following:

move to a public directory on yout server and dump your database

move into your local folder where you have already added you heroku keys and run the restore

And you’re done!

Related Posts

Deploy a Rails App with Heroku It's easy as pie to push a demo version of your rails app to heroku. Follow the simple steps below and you'll be on your way to testing in a subdomain...

David Chun

I'm a full stack developer that builds tools for marketing and managing ecommerce shops. I occasionally consult for startups. If you've got an interesting project, reach out.


Leave a Reply

Your email address will not be published. Required fields are marked *