Last active
December 26, 2015 07:29
-
-
Save stephenkeep/7115486 to your computer and use it in GitHub Desktop.
Heroku commands
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
//set environment variable | |
heroku config:set API_URL='<URL HERE>' --app <APP NAME> | |
//Database dump | |
heroku pgbackups:capture | |
curl -o latest.dump `heroku pgbackups:url` | |
//Restore locally | |
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump | |
//Restore - replace DATABASE with url such as HEROKU_POSTGRESQL_WHITE_URL | |
heroku pgbackups:restore DATABASE 'https://s3.amazonaws.com/me/items/3H0q/mydb.dump' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment