Skip to content

Instantly share code, notes, and snippets.

@nabucosound
Created November 26, 2013 13:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nabucosound/7658417 to your computer and use it in GitHub Desktop.
Save nabucosound/7658417 to your computer and use it in GitHub Desktop.

Heroku Cheatsheet

Made by Nabuco (http://nomadblue.com/).

Note: Substitute [params] with the proper values.

Start server installed from Homebrew:

pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

Create and download a pg backup on Heroku:

heroku pgbackups:capture --expire -a [heroku app name]
curl -o latest.pgdump `heroku pgbackups:url -a [heroku app name]`

Restore a local heroku backup file to local:

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U [dbuser] -d [dbname] latest.pgdump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment