#Migrate Postgres from Heroku to Railway

14 messages · Page 1 of 1 (latest)

polar tendon
#

I'm trying to migrate my postgres database from Heroku to Railway.
I already have a dump file from Heroku.
I'm following this guide to restore the database: https://blog.railway.app/p/postgre-backup#restoring-your-database-backup

However, when I run the command:
pg_restore -U <USER> -h <HOST> -p <PORT> -W -F t -d <DATABASE> latest.dump
I get the following error:
pg_restore: error: corrupt tar header found in PGDMP (expected 0, computed 19448) file position 512

Pls note:

  • I've tried running this command on both Windows and Ubuntu, still I get the same error
  • The dump file was created before Heroku removed the free tier. So now, I can't create a new dump file since heroku has deleted my data
Railway Blog

In this post, we will go over the process of backing up and restoring your Postgres database hosted on Railway.

violet saffronBOT
#

Project ID: 3bf60097-8588-44db-8386-146da476727f

polar tendon
#

3bf60097-8588-44db-8386-146da476727f

tulip sun
#

how do you know the dump file you have is not corrupted?

polar tendon
#

I don't...so this means that the file is corrupted?
Is there any possibility to migrate then?

#

I actually have a dump of all my projects which I had on Heroku previously.
I tried running the command on those different dump files as well. But they also show the same error...

tulip sun
#

i mean I'd look into ways to check if that file is corrupt.
but are you using the pg_restore tool that was released at the same time the pg_dump tool you used was released?

polar tendon
tulip sun
#

are you using the correct flags on pg_restore to restore the type of dump file you took?

#

oh yeah interesting, what format does that provide the dump in? I highly doubt your dump files are corrupted, they're just not in the format that pg_restore expects

polar tendon
#

it exports in .dump format, so my file name is like: latest.dump

tulip sun
polar tendon
#

It worked, Thank you so much for your time and help!! 😀

tulip sun
#

glad it worked! 🙂