Skip to content

Instantly share code, notes, and snippets.

@stevenschobert
Last active August 29, 2015 14:22
Show Gist options
  • Save stevenschobert/5bd5964948e3dcee155e to your computer and use it in GitHub Desktop.
Save stevenschobert/5bd5964948e3dcee155e to your computer and use it in GitHub Desktop.
Importing data from Heroku PostgeSQL application
heroku pg:backups capture
# replace BACKUP_NUM with backup number from above
heroku pg:backups public-url BACKUP_NUM
# replace URL with step from above
curl -o latest.dump URL
# replace LOCAL_DB_NAME with local database table
# replace DB_USERNAME with db user
# replace DB_CONNECTION with db connection
pg_restore --verbose --clean --no-acl --no-owner -h DB_CONNECTION -U DB_USERNAME -d LOCAL_DB_NAME latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment