0

when i try to upgrade Postgres from version 11 to version 13 using this command:

/usr/lib/postgresql/13/bin//pg_upgrade 
-b /postgresql/11/bin/ 
-B /postgresql/13/bin/ 
-d /data/service/postgres.1061/nanny/data/postgres 
-D /large_files/postgres/nanny/tmp.xrEaY5IPYM 
-U postgres -v -o '-c unix_socket_directories=/tmp/tmp.rfhIJiiAK3/socket'

it fails with the error

Old cluster data and binary directories are from different major versions during consistency checks.
Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263
  • More information 1) What OS and version? 2) Is this `/large_files/postgres/nanny/tmp.xrEaY5IPYM` actually a Postgres data directory? 3) If the `-d` and `-D` are actually pointing at Postgres data directories what is the content of `PG_VERSION` in each? – Adrian Klaver Jan 11 '23 at 17:30
  • centos 8, yes this large file is part of postgres data directory the pg version in /data/service/postgres.1061/nanny/data/postgres is 13 and pg version in /large_files/postgres/nanny/tmp.xrEaY5IPYM is also 13 – Muthu Naaraayanan Jan 11 '23 at 17:59
  • Then you can't use pg_upgrade as that is only for major version upgrades. You will need to use pg_dump/pg_restore or replication. – Adrian Klaver Jan 11 '23 at 18:16

1 Answers1

0

The problem is that the cluster in /data/service/postgres.1061/nanny/data/postgres is not version 11 (or that the binaries in /postgresql/11/bin/ are not version 11).

Laurenz Albe
  • 209,280
  • 17
  • 206
  • 263