Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: pg_restore: [archiver] unsupported version (1.14) in file header

I have a local Postgresql database that I am trying to import into a Heroku instance. I have Postgresql 12.1 installed. To create the dump file I am running:

pg_dump -Fc --no-acl --no-owner -h localhost -U nico nicoportfolio_development > mydb.dump

I then add the dump file to an aws s3 bucket.

Following the heroku documentation, I then create a presigned url:

aws s3 presign s3://nicoportfolio/mydb.dump

Finally I run the heroku pg restore command

heroku pg:backups:restore 'https://nicoportfolio.s3.amazonaws.com/mydb.dump?AWSAccessKeyId=AKIA2LPDMAPORY7QOOUK&Expires=1577325774&Signature=z6mBKKOVd6wPcFtCc8cjkjoKTLA%3D' DATABASE_URL

I get the following error:

pg_restore: [archiver] unsupported version (1.14) in file header

I've read several other posts regarding this topic which mentioned an outdated version of Postgres causing the problem but I have the most up to date version.

like image 774
nflauria Avatar asked Dec 05 '25 00:12

nflauria


1 Answers

Saving you a click, here's the fix:

Make the dump in simple SQL format:

pg_dump --no-owner mydb > mydb.dump

You may need to switch to the user who has rights to access your DB, postgres for example. So,

sudo su postgres 

and then make the dump.

And then load it with psql tool:

user@pc:~/path/to/your/dump$ heroku pg:psql < mydb.dump
like image 182
wachichornia Avatar answered Dec 07 '25 03:12

wachichornia