Skip to content

Instantly share code, notes, and snippets.

@ambethia
Created June 12, 2014 18:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ambethia/72eac5cecebeec13026e to your computer and use it in GitHub Desktop.
Save ambethia/72eac5cecebeec13026e to your computer and use it in GitHub Desktop.
Heroku DB pull and push.

Pull

curl -o db.dump `heroku pgbackups:url` 
pg_restore --verbose --clean --no-acl --no-owner -d DATABASE_NAME db.dump

Push

heroku pg:reset DATABASE_URL
pg_dump -xO DATABASE_NAME | psql `heroku config:get DATABASE_URL`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment