Symptoms
PostgreSQL will not start after upgrading to version 10. Using systemctl
to check the status will show entries similar to the following.
Dec 27 19:07:46 server.domain.tld postgresql-check-db-dir[1593975]: An old version of the database format was found.
Dec 27 19:07:46 server.domain.tld postgresql-check-db-dir[1593975]: Use 'postgresql-setup --upgrade' to upgrade to version '10'
Description
ELevate will upgrade the PostgreSQL service, but will not attempt to upgrade the PostgreSQL database due to the possibility of data loss. The PostgreSQL database must be manually upgraded.
Workaround
- Access the server's command line as the 'root' user via SSH or "Terminal" in WHM.
- Open
/var/lib/pgsql/data/postgresql.conf
in your preferred text editor. - Replace
unix_socket_directories
withunix_socket_directory
. - Save the changes and exit the text editor.
- Upgrade the PostgreSQL database.
postgresql-setup --upgrade
- Restart PostgreSQL.
/usr/local/cpanel/scripts/restartsrv_postgresql
Additional resources
Known cPanel ELevate Blockers: PostgreSQL database directory