Skip to content

Instantly share code, notes, and snippets.

@leesmith
Created August 16, 2012 18:58
Show Gist options
  • Select an option

  • Save leesmith/3372637 to your computer and use it in GitHub Desktop.

Select an option

Save leesmith/3372637 to your computer and use it in GitHub Desktop.
Restore heroku pg database to local pg database
# View backups and pick one to pull down
heroku pgbackups
# Download chosen backup
curl -o my_backup.dump `heroku pgbackups:url <backup_num>`
# Restore into local database
pg_restore --verbose --clean --no-acl --no-owner -h myhost -U myuser -d mydb my_backup.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment