If you get the error “pg_restore archiver unsupported version” while restoring, most propably it is because of the version. You may get this error because the version on the server you backed up from and the version on the server you want to restore are not the same. Or, if you checked the versions but still get the same error when you try to restore, it may be because you are using a different binary.
Let’s consider the scenario where the versions are the same but we use different binaries.
We go to both servers and run the following command and see that the versions are the same.
We saw that postgresql is 11.9 and let’s do the restore using version 11 as follows.
/usr/pgsql-11/bin/pg_restore -p 5434 -d dbname /var/lib/pgsql/11/data/backup.sql
-p = the part where we specify the port of postgresql11
-d = database name
– /var/lib/pgsql/11/data/backup.sql = The path information of the backup.