To upgrade to the required version of PostgreSQL:

    1.  Add the PostgreSQL repository.

          SLES 12: https://download.opensuse.org/repositories/server:/database:/postgresql/SLE_12_SP4/server:database:postgresql.repo

          NOTE:SLES 12 SP3 requires adding https://download.opensuse.org/repositories/security:/tls/SLE_12_SP4/x86_64/libopenssl1_0_0-1.0.2u-62.1.x86_64.rpm before you install postgresql11-server.

          SLES 15: https://download.opensuse.org/repositories/server:/database:/postgresql/SLE_15/server:database:postgresql.repo

          SLES 15 SP1: https://download.opensuse.org/repositories/server:/database:/postgresql/SLE_15_SP1/server:database:postgresql.repo

          RHEL 7: https://download.postgresql.org/pub/repos/yum/reporpms/EL-7-x86_64/pgdg-redhat-repo-latest.noarch.rpm

          RHEL 8: https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

    2.  For either SLES or RHEL, install postgresql11-server through the package manager.

    3.  At the command line, type the following to back up the Identity Governance and Identity Reporting databases:

          "${PATH_TO_POSTGRESQL}/bin/pg_dump" -h "localhost" -p "5432" -U "postgres" -Fc "igops" > "igops.dump"

          (For upgrades from Identity Governance 3.5) "${PATH_TO_POSTGRESQL}/bin/pg_dump" -h "localhost" -p "5432" -U "postgres" -Fc "igarc" > "igarc.dump"

          "${PATH_TO_POSTGRESQL}/bin/pg_dump" -h "localhost" -p "5432" -U "postgres" -Fc "igdcs" > "igdcs.dump"

          "${PATH_TO_POSTGRESQL}/bin/pg_dump" -h "localhost" -p "5432" -U "postgres" -Fc "igwf" > "igwf.dump"

          "${PATH_TO_POSTGRESQL}/bin/pg_dump" -h "localhost" -p "5432" -U "postgres" -Fc "igara" > "igara.dump"

          "${PATH_TO_POSTGRESQL}/bin/pg_dumpall" -h "localhost" -p "5432" -U "postgres" --roles-only [--no-role-passwords] > "roles.sql"

          NOTE: Use [--no-role-passwords] only for cloud-based setups where SU (or root) access is not allowed and the passwords cannot be retrieved. Upon restoration, administrators must restore their passwords manually.

    4.  Rename the PostgreSQL data folder, and then create a new /data folder.

    5.  (Optional) Rename the PostgreSQL /bin folder, and then create a new /bin folder.

    6.  Place your PostgreSQL password as the only line in a file.

          vi /tmp/pg_secret_to_remove

    7 . Configure PostgreSQL 11 as follows:

          export FILE_CONTAINING_PG_PASSWORD="/tmp/pg_secret_to_remove"

          export PATH_TO_POSTGRESQL_DATA="/opt/netiq/idm/apps/postgres/data"

          export ADMIN_POSTGRESQL="postgres"

          For SLES: runuser -l postgres -c "/usr/lib/postgresql11/bin/initdb --auth='md5' --pwfile='${FILE_CONTAINING_PG_PASSWORD}' --username='${ADMIN_POSTGRESQL}' --pgdata='${PATH_TO_POSTGRESQL_DATA}'"

          For RHEL: runuser -l postgres -c "/usr/pgsql-11/bin/initdb --auth='md5' --pwfile='${FILE_CONTAINING_PG_PASSWORD}' --username='${ADMIN_POSTGRESQL}' --pgdata='${PATH_TO_POSTGRESQL_DATA}'"

    8.  Remove the file in which you placed your PostgreSQL password.

          rm /tmp/pg_secret_to_remove

    9.  Copy the following older files to the new data directory:

          pg_hba.conf

          postgresql.conf

    10. Type one of the following commands to enable and restart the PostgreSQL service:

          SLES: postgresql.service

          RHEL: postgresql-11.service

    11. At the command line, type the following commands to restore the Identity Governance and Identity Reporting databases:

          "${PATH_TO_NEW_POSTGRESQL}/bin/psql" -h "localhost" -p "5432" -U "postgres" -d "postgres" -f "roles.sql"

          "${PATH_TO_NEW_POSTGRESQL}/bin/createdb" -h "localhost" -p "5432" -U "postgres" -T template0 "igops"

          "${PATH_TO_NEW_POSTGRESQL}/bin/pg_restore" -h "localhost" -p "5432" -U "postgres" -d "igops" -Fc "igops.dump"

          For Identity Governance 3.5: "${PATH_TO_NEW_POSTGRESQL}/bin/createdb" -h "localhost" -p "5432" -U "postgres" -T template0 "igarc"

          For Identity Governance 3.5: "${PATH_TO_NEW_POSTGRESQL}/bin/pg_restore" -h "localhost" -p "5432" -U "postgres" -d "igarc" -Fc "igarc.dump"

          "${PATH_TO_NEW_POSTGRESQL}/bin/createdb" -h "localhost" -p "5432" -U "postgres" -T template0 "igdcs"

          "${PATH_TO_NEW_POSTGRESQL}/bin/pg_restore" -h "localhost" -p "5432" -U "postgres" -d "igdcs" -Fc "igdcs.dump"

          "${PATH_TO_NEW_POSTGRESQL}/bin/createdb" -h "localhost" -p "5432" -U "postgres" -T template0 "igwf"

          "${PATH_TO_NEW_POSTGRESQL}/bin/pg_restore" -h "localhost" -p "5432" -U "postgres" -d "igwf" -Fc "igwf.dump"

          "${PATH_TO_NEW_POSTGRESQL}/bin/createdb" -h "localhost" -p "5432" -U "postgres" -T template0 "igara"

          "${PATH_TO_NEW_POSTGRESQL}/bin/pg_restore" -h "localhost" -p "5432" -U "postgres" -d "igara" -Fc "igara.dump"

