Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin

D toc

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

D s item
itemdatabases
rtrue
 for a working deployment of the 
D s platform
.

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

Info

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.

  • The installing user must have write permissions to the directory from which the commands are executed.
  • The installing user must have sudo privileges.
  • Verify that you know the host and port number for each database.

Backup

Before you begin, please verify that you have a valid backup of each 

D s item
itemdatabase
. See Backup and Recovery in the Admin Guide.

Acquire Distribution and Port Information

Before you begin, you must:

  • Acquire the port information for the current database. Typically, this value is 5432.
    d-s-pssql-port
  • Acquire the latest distribution for the database software.

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 

D s item
itemdatabases
. This procedure assumes the following:

  • All current databases are co-located with the software on the 
    D s node
    .
  • Some downtime of the databases during the upgrade process is ok.

Before you begin

  • If you haven't already, please back up each database and all PostgreSQL configuration files. See Backup and Recovery in the Admin Guide.
  • Login to the node where the databases are hosted.

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:

  • Source version: PostgreSQL 9.6
  • Upgrade version: PostgreSQL 12

Info

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


Info

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:

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

PostgreSQL 12 example path:

Code Block
/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

Info

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. 
    D s config
    methodtriconf

    1. Replace all instances of the PostgreSQL port number for the earlier version and replace with the desired port number for the upgrade version. 
      d-s-pssql-port
    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:

    Info

    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:

      Code Block
      sudo service postgresql-9.6 start
    2. Ubuntu:

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

      Code Block
      ./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 

    D s item
    itemsoftware
    . 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:

    Code Block
    ./delete_old_cluster.sh
  3. Restart the 
    D s platform
    . See Start and Stop the Platform in the Install Guide.