I did a backup of a database using pg_basebackup. I need to restore it to another server. The database version in the source server is 9.2.23. The destination server postgresql version is 12. Will there be any problems if I restore from the 9.2.23 to 12?
2 Answers
Yes, there will be problems. That won't work.
You have to restore the backup with PostgreSQL 9.2, only then you can upgrade.
pg_basebackup
is basically a controlled, safe way to take a copy of the Postgres data directory. That directory is specific to each major version of Postgres, so it can only be restored to that version of Postgres. So you'll need to restore first using Postgres 9.2 and upgrade later.