Skip to content

Instantly share code, notes, and snippets.

@ascot21
Created January 4, 2014 22:23
Show Gist options
  • Save ascot21/8261528 to your computer and use it in GitHub Desktop.
Save ascot21/8261528 to your computer and use it in GitHub Desktop.
Export Local DB & Importing to Heroku

First, create a dump of local DB:

pg_dump -Fc --no-acl --no-owner -h localhost -U USER_NAME DATABASE_NAME > mydb.dump

Upload the mydb.dump file to a web server (ie. Dropbox, S3, etc...)

Import to Heroku

heroku pgbackups:restore DATABASE 'PATH_TO_HOSTED_DB_DUMP_FILE'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment