We are planning to migrate our database from v11 to v15. We have configured WAL backup. Can we use these files to restore database on v15 PostgreSQL or must we do dump/restore?
Question posted in PostgreSQL
The official documentation can be found here.
The official documentation can be found here.
2
Answers
No, a file system level backup (
pg_basebackup
or similar) can only be restored on the same version and operating system as the original.Your alternatives are
pg_dumpall
/restore,pg_upgrade
or logical replication.You will restore what you backed up. If your backup is of v11, you will get v11 restored, and then need to upgrade it again.
There is a ticklish situation between the
pg_upgrade
and the firstpg_basebackup
taken on v15. You might have all the WAL files, but you won’t have a base backup (of the correct version) on which to apply them. So you need to take a new base backup right after thepg_upgrade
, and that should be included as part of the downtime planning.