Skip to content

Instantly share code, notes, and snippets.

@qnm
Created November 4, 2014 22:35
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 qnm/d66d3d634417978a9e6c to your computer and use it in GitHub Desktop.
Save qnm/d66d3d634417978a9e6c to your computer and use it in GitHub Desktop.
Restoring Heroku DB to AWS
Restoring an Heroku dump to RDS, using an intermediate EC2 box:
Using the guide at https://devcenter.heroku.com/articles/heroku-postgres-import-export
# curl -o latest.dump `heroku pgbackups:url`
# scp -i ~/.ssh/id_rsa latest.dump ec2-user@ec2-xx-xx-xx-xx.ap-southeast-2.compute.amazonaws.com:/tmp/
# ssh -i ~/.ssh/id_rsa latest.dump ec2-user@ec2-xx-xx-xx-xx.ap-southeast-2.compute.amazonaws.com
# cd /tmp
# pg_restore --verbose --clean --no-acl --no-owner -h $RDS_HOSTNAME -U $RDS_USERNAME -d $RDS_DB_NAME latest.dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment