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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With