PostgreSQL Installation or Upgrade
If you wish the installation, upgrade, and configuration of the PostgreSQL on your server, then follow the given steps.
- Use /usr/local/cpanel/scripts/installpostgres commandTh
This command upgrades or installs PostgreSQL.
- ConfigurePostgreSQL interface of WHM must be accessed through WHM >> Home >> SQL Services >> Configure PostgreSQL
- In case PostgreSQL does not exist on the server, the user will have the option to select Install Config while in case PostgreSQL exists on your server, this process replaces the authentication file for configuration.
- Add existing cPanel users to PostgreSQL by employing the Create Users option.
- In the Enter New Password box, input a new password. Make sure to avoid non-alphanumeric characters and symbols to bypass errors.
- Select Change Password after confirmation of a new password.
- Use psql -U postgres dbname < dumpfile.sql command to restore your data directories.
How to Restore a Previous PostgreSQL Version Successfully?
Users will revert to their previous version of PostgreSQL if the new installation procedure fails. Thus, previous PostgreSQL databases can be restored. The following commands are used.
- service postgresql stop
- mv /var/lib/pgsql.old /var/lib/pgsql
- service postgresql restart