Skip to content

Instantly share code, notes, and snippets.

@lightcap
Created December 7, 2011 00:34
Show Gist options
  • Save lightcap/1440810 to your computer and use it in GitHub Desktop.
Save lightcap/1440810 to your computer and use it in GitHub Desktop.
Restore Heroku Postgresql db to Engine Yard Cloud (Assuming beta postgres at EY)
# On Heroku
# Create dump file
heroku pgbackups:capture --app <application_name>
# On Engine Yard slice
# Get dump file from heroku
curl -o latest.dump `heroku pgbackups:url b005 --app <application_name> -e <environment>`
# drop and recreate database
bundle exec rake db:drop
bundle exec rake db:create
# Restore db
pg_restore --verbose --clean --no-acl --no-owner -U deploy -d <database_name> ~/latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment