Skip to content

Instantly share code, notes, and snippets.

@lenart
Last active November 18, 2015 12:58
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 lenart/fb31fcd2521d6f72760c to your computer and use it in GitHub Desktop.
Save lenart/fb31fcd2521d6f72760c to your computer and use it in GitHub Desktop.
Get production database from heroku and update it locally
# Using [parity](https://github.com/thoughtbot/parity)
development restore production
development restore staging
# Steps for manual backup
heroku pg:backups capture --remote production
curl `heroku pg:backups public-url --remote production` > tmp/db.dump
psql [db_name]
drop schema public cascade;
create schema public;
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d [db_name] tmp/db.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment