Skip to content

Instantly share code, notes, and snippets.

@stephenkeep
Last active December 26, 2015 07:29
Show Gist options
  • Save stephenkeep/7115486 to your computer and use it in GitHub Desktop.
Save stephenkeep/7115486 to your computer and use it in GitHub Desktop.
Heroku commands
//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