Hi Siddhartha,
We just did something similar. We had Postrgresql 11 on CentOS 7.9 and needed to get to RHEL 9.4
We set up new hardware as RHEL 9.4 and installed Postgresql 15.10 on it but didn't initialize the DB.
You can get the repos set up on CentOS 7 via:
We then upgraded the CentOS 7.9 system using the --link option:
/usr/pgsql-15/bin/pg_upgrade --link --verbose &> ~/pg_upgrade_15.log
On our DB, this took only about 9 seconds (we run just a couple DBs but one has is tracking 30 million file details) but we have the DB on NVMe devices.
Once you are synchronized, you can shutdown the master, shutdown the slave, reconfigure the slave to be the former master (change hostname and IP adddress(es)) and bring it back up.
To get to 16 you can run the pg_upgrade command similarly to how you did the original master on CentOS 7.9. This process should minimize the amount of time you have to be down.
Shawn
I believe the best way would be to
1. setup a new rhel9 server with pg16
2. get a dump (pg_dumpall) from the old machine onto the new machine
3. restore that dump
4. copy pg_hba.conf and postgresql.conf over to the new machine
4.1. make sure to keep the new postgresql.conf and adjust custom settings you may have on the old machine with making sure those settings have not changed
If you want to do this close to zero downtime, you could set up logical replication to the new pg16 machine and once that is finished switch over and promote that to be the new main.
On 04.12.24 14:03, Siddhartha Jain wrote:
Hi,
Please let me know if Postgresql 16 is compatible with RHEL 7.9 version and RHEL 9.1 version.
I need to upgrade postgres from 11.22 to 16.6 and need information for that as the OS version is going to upgrade from 7.9 to 9.1.
Also, let me know the strategies if any to upgrade both RHEL and DB.
Thanks,
Siddhartha