Skip to main content

Sync Heroku to Hatchbox database

Please refer to this tutorial first: https://wiki.sigbit.app/books/hatchbox/page/restore-local-sql-dump-to-hatchbox

1. Download file from Heroku

If you need to download the database from heroku, do this:

heroku pg:backups:capture --app example-app
heroku pg:backups:download --app example-app

2. Send file to server

scp ./latest.dump deploy@13.51.249.208:/home/deploy

3. Load the dump file into the hatchbox database

Find the database information in the https://app.hatchbox.io/database_clusters page on Hatchbox.

pg_restore --verbose --clean --no-acl --no-owner -h localhost -U user_6353c004a1da -d db_94eeb162733f latest.dump

This will result in some errors but these can most likely be ignored since they are related to heroku tables.