Steps to install PostgreSQL in cPanel server

PostgreSQL is a powerful object-relational database management system. Let’s see the steps to install PostgreSQL in cPanel server. cPanel & WHM works with PostgreSQL 7.3.x or later. Earlier versions will not work with cPanel & WHM.

Steps to install PostgreSQL in cPanel server:

Step 1: Login to the server via SSH as root.

Step 2: If you have PostgreSQL 7.2.x installed, back up your databases using pg_dumpall or some other method.

==========
Backup: $ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql}

Restore: $ psql -U {user-name} -d {desintation_db}-f {dumpfilename.sql}
==========

Step 3: If you have databases you wish to keep, move your existing PostgreSQL data directory somewhere else by, for example, typing the following command.

~~~~~
mv /var/lib/pgsql /var/lib/pgsql.old
~~~~~

Step 4: Installing PostgreSQL in cPanel server (CentOS).

Execute the following cPanel script to install PostgreSQL. This script executes yum install postgresql.

~~~~~
/scripts/installpostgres
~~~~~

Step 5: Login to your WHM.

Step 6: Select Postgres Config in the SQL Services section of WHM.

~~~~
WHM >> SQL Services >> Postgres Config
~~~~

Step 7: In the “Postgres Password” section, specify the new password and click “Change Password”.

Step 8: If you are installing PostgreSQL for the first time, click the Install Config button.

Step 9: If you are upgrading from PostgreSQL 7.2.x or earlier, restore the SQL dump you created in step 3 by using psql or some other method.

Step 10: PostgreSQL is now accessible from your cPanel interface.

Advertisements
  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: