Install or Update PostgreSQL on Your cPanel & WHM Server
For cPanel & WHM version 11.40
You can install or update PostgreSQL on your server. However, we strongly
recommend that you have an experienced PostgreSQL database administrator perform this process.
cPanel & WHM works with the version of PostgreSQL that is distributed with your operating system.
Before you install or update PostgreSQL on your server, you should first back up the databases on your server. This will allow you to restore your databases after you install or update PostgreSQL.
To back up of your databases, perform the following steps as the
- Use a method such as the
pg_dumpall command to back up the databases on your server.
- If you wish to be able to revert to your previous version of PostgreSQL, you will need to move your existing PostgreSQL Data Directory. To do this, execute the following commands:
service postgresql stop — This command stops PostgreSQL so that you can move the data directory.
Note: If you enabled monitoring via WHM's Service Manager feature (Home >> Service Configuration >> Service Manager), uncheck the box in the Monitor column before you run this command. This will prevent an automatic restart of the PostgreSQL service after you stop it.
mv /var/lib/pgsql /var/lib/directory_file_name — This command moves your existing PostgreSQL Data Directory to a new location.
with the actual directory name.
Install and Configure PostgreSQL
- To begin the installation process on a CentOS or Red Hat system, run the
- Access the Configure Postgres feature in WHM. (Home >> SQL Services >> Configure Postgres)
- Click the Install Config button if this your first time to install PostgreSQL.
Warning: If you already have a PostgreSQL configuration, this will overwrite your configuration authentication file.
- Click Create Users to add existing cPanel users to Postgres.
- Enter a new password in the Enter New Password text box.
- Confirm your new password and click Change Password.
Warning: Only use letters and numbers. Non-alphanumeric characters can cause problems.
- Run the
psql command to import your databases.
In the event the new installation fails, you may be able to revert to your previous version of PostgreSQL and restore the earlier PostgreSQL data directory. To do this, run the following commands:
service postgresql stop
mv /var/lib/pgsql /var/lib/directory_file_name
mv /var/lib/pgsql.old /var/lib/pgsql
service postgresql restart
For more information about PostgreSQL, visit the PostgreSQL website
cPanel, Inc. does not
supply PostgreSQL or provide RPMs to update PostgreSQL to the latest version.
Topic revision: r19 - 19 Sep 2013 - 18:13:35 - Main.JenniferDoubrava