How to upgrade Postgresql92 database to Postgresql95 on Red Hat Satellite 5.7?

Solution Verified - Updated -

Environment

  • Red Hat Satellite 5.7

Issue

  • Latest postgresql92-postgresql-9.2.15 available on satellite-5.7 repository is vulnerable to following CVE's:
  • How to migrate PostgreSQL database from postgresql92 to postgresql95

Resolution

  • PostgreSQL92 collection is EOL now. So, satellite 5.7 database need to migrate from Postgresql92 to Postgresql95

CAUTION: please ensure that there is enough free space under the /var/opt directory. The amount of free space required should be at least equal to the size of your /opt/rh/postgresql92/root/var/lib/pgsql/ directory.

To migrate the Database:

a) Update the Satellite server to get latest rh-postgresql95-postgresql and dependencies that are available from satellite-5.7-server repository:

        # yum update 

b) Run the following command on your database machine (NOTE: in the embedded-database case this is the Satellite system itself; otherwise, run the command on the system running your PostgreSQL database):

        # /usr/bin/spacewalk-upgrade-postgresql    

This will migrate the database to psql 9.5 and remove old postgresql92 package.

c) Also, update the satellite-schema version if update available:

       # rhn-schema-version 
       # spacewalk-schema-upgrade 

Root Cause

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.