Created
February 7, 2015 10:37
-
-
Save gentilfp/76fc75fbf3853d95eb32 to your computer and use it in GitHub Desktop.
Importing and Exporting Heroku database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Export | |
$ heroku pgbackups:capture | |
$ curl -o latest.dump `heroku pgbackups:url --app APP` | |
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump | |
# Import | |
$ PGPASSWORD=mypassword pg_dump -Fc --no-acl --no-owner -h localhost -U myuser mydb > mydb.dump | |
$ heroku pgbackups:restore DATABASE 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump' | |
https://devcenter.heroku.com/articles/heroku-postgres-import-export |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment