How to restore a backup of my database

aetogithub
PRO

a year ago

I have a local backup that I want to restore, but I can't.

I have tried with the pg restore command as follows:& "C:\Program Files\PostgreSQL\16\bin\pg_restore.exe" -U <username> -h <host> -p <port> -W -F t -d <db_name> "C:\Users\josec\Documents\A E T O\backups_aeto\rescue88.sql"

And I get the following errorpg_restore: error: Corrupt header found in PGDMP (expected 0, calculated 19991) at position 512

3 Replies

a year ago

Are you sure to use pg_restore version 16?


aetogithub
PRO

a year ago

Yes, since to do a local restore I can only do it with version 16, if I try it with version 15 it won't let me


a year ago

Then you may have a corrupt backup file.