BuycPanel Blog

BuycPanel Blog

Latest news and updates

Want More from Your cPanel? Install and Update PostgreSQL

Posted by Alex on 10 04 2017.

An open source, database management system (DBMS), PostgreSQL (“post-gress-Q-L”) was born through the collaboration of the brains of some of the most talented people in the world. No company or corporation has control over it. And best of all, you can get the source code without spending any money.

One of the best things about PostgreSQL is that it support capability. It can support many different transactions, triggers, foreign key referential integrity, views, and subselects. In terms of compatibility, you also do not have to worry, as you can run it on a wide variety of platforms, including Window, Mac OS X, Linux, Solaris, UNIX, and Tru64. Whether you need text, photos, videos, or audio, you can rely on this DBMS to handle it.

cPanel and PostgreSQL Compatibility

When you use cPanel, one of the, if not the most common and popularly used Linux-based control panels all over the world, you can install PostgreSQL. In fact, you can get more from your cPanel experience with this open source DBMS, because aside from the features mentioned above, it also comes with an array of programming interfaces for Java, Python, Ruby, Tcl, C / C++ , and Open Database Connectivity ( ODBC ).

Important Reminders

While it is not that difficult to install PostgressSQL, you should still have an advanced PostgreSQL database administrator conduct the procedure, especially when it comes to updating the DBMS.

Note also that cPanel does not work as a supplier for PostgreSQL. It also does not provide RPMs for the DMBS’ update to the latest version. You would have to manually update it.

Pre-Installation Must-Dos: Backup Your Databases

Prior to the installation or update for PostgreSQL, make sure that you first create backups for all the databases in your server’s. Doing so will ensure you can restore them after the installation or the update has completed.

Here are the steps to create the back up before the PostgreSQL installation or update:

  1. As a root user via SSH, log in to the server.
  2. Execute the command: pg_dumpall. This serves as the tool to create the backups of your server’s databases. Just in case you want to restore to the previous PostgreSQL version, you need to move the current data directory of PostgreSQL. Execute these commands to complete this task:
  • service postgresql stop
  • mv /var/lib/pgsql /var/lib/directory_file_name
  1. Look for the directory named: /directory_file_name and replace it with the real directory name.

Installing and Modifying Your PostgreSQL

Now that you have finished creating the database backup, you can proceed to the installation and configuration of the PostgreSQL. To do this, follow these steps:

  1. Execute the command: /scripts/installpostgres for the PostgreSQL installation.
  2. Navigate to the WHM’s interface named “Configure PostgreSQL” by going back to your interface’s Home then navigating to SQL Services, and finally, Configure Postgres.
  3. For first time installers of the DBMS, choose the “Install Config” option. Keep in mind though that in the event you already have PostgreSQL installed on the server, clicking on this button will overwrite the current configuration authentication file.
  4. Click the buttons for “Create Users” in order to allow your existing cPanel users access to the DBMS.
  5. Key in a new (strong) password in the text box titled “Enter New Password”.
  6. Enter the same password you just keyed in on the confirmation password text box provided.
  7. Click the button for the “Change Password” option.
  8. Execute the command: psql so you can already import all your databases.