Search code examples
herokuheroku-postgres

Forgot to migrate free tier Postgres and now my app is empty


My project is again live no problems whatsoever, but the database is empty.

I am either trying to restore an old backup to the new Postgres instance or upload a backup from my local disk.

I tried to do pg:restore but I don’t know where to grab the backup (from the free Heroku tier).


Solution

  • I got the answer I was looking for by going into some of the most hidden help articles in heroku.

    https://help.heroku.com/QG1W7LIJ/how-do-i-restore-a-partial-backup-or-single-table-to-heroku-postgres

    pg_restore --verbose --clean --no-acl --no-owner -h localhost -U YOUR_USERNAME-d CONNECTION_URL mydb.dump
    

    Had to recreate the backup from the local imported database but at the end it worked flawlessly.