PostgreSQL Service Failing to Start on Red Hat Capsule Server after performing Leapp Upgrade from RHEL 7 to RHEL 8
Issue
- Failed to start PostgreSQL database server after upgrading RHEL OS from 7 to 8.
-
Leapp upgrade completed but PostgreSQL service failing to start.
Jan 27 18:49:21 capsule.example.com systemd[1]: Starting PostgreSQL database server... Jan 27 18:49:21 capsule.example.com postmaster[13737]: 2023-01-27 18:49:21.903 GMT [13737] LOG: skipping missing configuration file "/var/opt/rh/rh-postgresql12/lib/pgsql/data/postgresql.auto.conf" Jan 27 18:49:21 capsule.example.com postmaster[13737]: 2023-01-27 18:49:21 UTC FATAL: "/var/opt/rh/rh-postgresql12/lib/pgsql/data" is not a valid data directory Jan 27 18:49:21 capsule.example.com postmaster[13737]: 2023-01-27 18:49:21 UTC DETAIL: File "/var/opt/rh/rh-postgresql12/lib/pgsql/data/PG_VERSION" is missing. Jan 27 18:49:21 capsule.example.com systemd[1]: postgresql.service: Main process exited, code=exited, status=1/FAILURE Jan 27 18:49:21 capsule.example.com systemd[1]: postgresql.service: Failed with result 'exit-code'. Jan 27 18:49:21 capsule.example.com systemd[1]: Failed to start PostgreSQL database server. -
The
postgresql.conffile pointing to the oldPostgreSQLdata directory, whereas it should be/var/lib/pgsql/data, how to correct it?port = 5432 data_directory = '/var/opt/rh/rh-postgresql12/lib/pgsql/data'
Environment
- Red Hat Satellite 6.11
- Red Hat Enterprise Linux 8.6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.