This section describes the requirements and pre- and post-upgrade steps for upgrading the PostgreSQL database server of the  for a working deployment of the .

When you upgrade to a new release of the platform, the underlying databases and their structures are automatically migrated to the new format. However, the database releases are not touched. 

Pre-requisites

NOTE: Responsibility for performing the actual upgrade of the database server is the responsibility of the customer. Please review this section before you perform the database server upgrade.

Backup

Before you begin, please verify that you have a valid backup of each . See Backup and Recovery in the Admin Guide.

Acquire Distribution and Port Information

Before you begin, you must:

For more information, see Install Databases for PostgreSQL.

For more information, see Install Databases for MySQL.

Database Prep

This procedure describes the process for upgrading the PostgreSQL version in use by the . This procedure assumes the following:

Before you begin

Using non-default ports

The default port for these commands is port 5432.

If you are using a non-standard port for either the pre- or post-upgrade versions of PostgreSQL, you can use the following parameters with the pg_upgrade command:

ParameterDescription
--old-port=<pre-upgrade_port>The port number of the pre-upgrade instance of PostgreSQL
--new-port=<post-upgrade_port>The port number to use for the post-upgrade instance of PostgreSQL

For more information, see https://www.postgresql.org/docs/9.6/pgupgrade.html.

Upgrade PostgreSQL 9.6 to 12

The following sections cover upgrading the versions listed below:

NOTE: The database version upgrade must be performed after you have upgraded the software.


NOTE: The database client is installed as part of this upgrade. No further action is required to enable use of the database client.


PostgreSQL path references

In PostgreSQL 10 and later, directory references to versions of PostgreSQL paths have changed. 

PostgreSQL 9.6 example path:

/var/lib/pgsql/9.6/data/pg_hba.conf

PostgreSQL 12 example path:

/var/lib/pgsql/12/data/pg_hba.conf

For more information, see https://wiki.postgresql.org/wiki/YUM_Installation.


Upgrade for CentOS/RHEL - PostgreSQL 9.6 to 12

For more information, see https://www.postgresql.org/docs/.

Upgrade for Ubuntu - PostgreSQL 9.6 to 12

For more information, see https://www.postgresql.org/docs/.

Upgrade on Amazon RDS - PostgreSQL 9.6 to 12

NOTE: After upgrading to PostgreSQL on Amazon RDS, you may encounter an I/O error when importing data in which the storage location has the wrong hash version. The solution is to reindex tables. For more information, see https://aws.amazon.com/blogs/database/postgresql-12-a-deep-dive-into-some-new-functionality/.

For more information, see https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html.

Transfer Settings

For all operating systems, you must transfer the settings from your old version of PostgreSQL to the new one.

  1. Update the port number and any other settings in the platform configuration. 
    1. Replace all instances of the PostgreSQL port number for the earlier version and replace with the desired port number for the upgrade version. 
    2. Make the above changes and save the file.
  2. Transfer settings from the configuration files for your old database version to the new one. Please review the old and new versions of these files:

    NOTE: It is risky to perform a straight copy of these configuration files. Settings may change. New ones may be introduced. Setting values specific to to the installation may be overwritten in a copy. Please retain a backup of both versions of each file before migrating settings.

    Path to PostgreSQL 9.6 filePath to PostgreSQL 12 file
    /var/lib/pgsql/9.6/data/pg_hba.conf/var/lib/pgsql/12/data/pg_hba.conf
    /var/lib/pgsql/9.6/data/postgresql.conf/var/lib/pgsql/12/data/postgresql.conf
  3. Start the service:
    1. CentOS/RHEL:

      sudo service postgresql-9.6 start
    2. Ubuntu:

      sudo service postgresql start
    3. When the service restarts, you can check the cluster status using the following script:

      ./analyze_new_cluster.sh
  4. After you have completed the database installation, you must review the port number of the newly installed database, which may have changed between versions of the database software. That new port number must be applied through the . For more information, see Change Database Port.

  5. If all is well, restart the platform. See Start and Stop the Platform in the Install Guide. 

Verify and Cleanup

  1. Verify operations on all databases:
    1. Login to the application.
    2. Load a dataset from Flow View.
    3. Run a job. 
    4. Schedule a job and execute it.
    5. See Verify Operations in the Admin Guide.
  2. If all of the above tests pass, you can use the following script to delete the old PostgreSQL version and its data directory:

    ./delete_old_cluster.sh
  3. Restart the . See Start and Stop the Platform in the Install Guide.