Skip to content

Instantly share code, notes, and snippets.

@geekforbrains
Last active August 9, 2021 15:59
Show Gist options
  • Save geekforbrains/be26ffd620949197cc5919a4607a3e05 to your computer and use it in GitHub Desktop.
Save geekforbrains/be26ffd620949197cc5919a4607a3e05 to your computer and use it in GitHub Desktop.
Restore Heroku database from dump file
$ heroku pg:backups:capture -a APP_NAME
$ heroku pg:backups:download -a APP_NAME
$ heroku pg:credentials:url DATABASE_NAME -a APP_NAME
$ pg_restore --verbose --clean --no-acl --no-owner -h HOSTNAME -U USER -d DATABASE -p PORT latest.dump --password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment