2

I am trying to upgrade my postgreSQL 10 database on Ubunutu 18.04 server to postgreSQL 12. I have installed the 12 binaries and post shutdown of the 10 intance, I am running the check command as shown below and it fails with the below error. The /pgsqlp/data/pg12 is the new data directory and /pgsqlp/data/pgdata is my old data directory. I can manually touch the file in the new directory but then it fails to create the next directory. Is there any debug option or additonal logging that can be enabled for pg_upgrade to check where the error is ?

time /usr/lib/postgresql/12/bin/pg_upgrade -b /usr/lib/postgresql/10/bin -B /usr/lib/postgresql/12/bin -d /pgsqlp/data/pgdata -D /pgsqlp/data/pg12 -c

could not open version file "/pgsqlp/data/pg12/PG_VERSION": No such file or directory Failure, exiting

real 0m0.011s user 0m0.007s sys 0m0.004s

balaks80
  • 136
  • 1
  • 7

1 Answers1

2

Steps that finally worked for the upgrade are :

  1. Stop the old instance.
  2. Install pg12 binary
  3. Initiate an empty instance/cluster to the new target data directory.
  4. Stop both the new instances.
  5. Run the pg_upgrade from the pg12 binary location and perform post steps.
  6. Remove the old instance and data directory.
balaks80
  • 136
  • 1
  • 7