PostgreSQL 11.x version has reached end of life and is no longer supported by the community. AIX Toolbox team will be uploading PostgreSQL 15 (15.4) to AIX Toolbox soon. It is therefore recommended that customers use PostgreSQL 15 going forward from AIX Toolbox.
Since this is a major version update, internal data storage format is subject to change. Thus, users are requested to perform the steps necessary to migrate their databases. There are several methods to migrate database from one major version to another (traditional backup and restore method is preferred (section 19.6.1)). For detailed information on the various methods and the steps involved in database migration, please refer https://www.postgresql.org/docs/15/upgrading.html . Users are recommended to go through this link before updating to the new version.
In order to alert the users of this, we have made couple of packaging changes.
1. 1. RPMS have been renamed from postgresql to postgresql15. So, inorder to install postgresql 15 one has to run the following command
dnf install postgresql15
2. 2. We have also added Conflicts: postgresql-libs < 15 in postgresql15 spec file. As a result, if an older version of postgresql is already installed in the system, then the installation would fail with the following error.
package postgresql15-libs-15.4-1.ppc conflicts with postgresql-libs < 15 provided by postgresql-libs-11.20-1.ppc
In this case, one has to remove the older version of postgresql first and then install the new version.
For example:-
Suppose the database directory is /var/lib/postgresql/data, following would be the sequence of steps to migrate the database.
1. 1. Create a backup of the existing database
pg_dumpall > outputfile
2. 2. Shut down the old server
pg_ctl -D /var/lib/postgresql/data -l logfile stop
3. 3. Rename the old installation directory just in case some issue is encountered and one wants to revert back to it
mv /var/lib/postgresql/data /var/lib/postgresql/data.bak
4. 4. Install the new version of postgresql
5. 5. Create a new database cluster if needed
initdb -D /var/lib/postgresql/data
6. 6. Start the database server
pg_ctl -D /var/lib/postgresql/data -l logfile start
7. 7. Restore the data from backup
psql -d postgres -f outputfile
------------------------------
RESHMA KUMAR
------------------------------
#AIXOpenSource