Skip to content

Instantly share code, notes, and snippets.

@osulyanov
Created November 21, 2013 07:07
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 osulyanov/7577211 to your computer and use it in GitHub Desktop.
Save osulyanov/7577211 to your computer and use it in GitHub Desktop.
Heroku tips
# Set up heroku app
heroku git:remote -a app_name
# Create db backup
heroku pgbackups:capture
# Download last db backup
curl -o latest.dump `heroku pgbackups:url`
# Restore local base from Heroku
pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
# Add postgresapp path
PATH="/Applications/Postgres93.app/Contents/MacOS/bin:$PATH"
# Create far dump
pg_dump -U postgres -W -h localhost autoporta_production -F t -f dump.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment