Last active
November 24, 2015 20:30
-
-
Save heatherm/c7cd93be01ea0ae90436 to your computer and use it in GitHub Desktop.
Heroku PG Backups - Restore to Staging or Local
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
heroku pg:backups capture --app production | |
heroku pg:backups --app production | |
*note the code for the latest backup* (ex: b017) | |
PROD -> STAGING | |
heroku pg:backups restore `heroku pg:backups public-url b017 --app production` DATABASE --app staging | |
PROD -> LOCAL | |
curl -o latest.dump `heroku pg:backups public-url b017 --app production` | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -d db_name latest.dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@heatherm
heroku pg:pull DATABASE_URL tss_development -r production