D toc |
---|
This section describes the requirements and pre- and post-upgrade steps for upgrading the PostgreSQL database server of the
D s item | ||||
---|---|---|---|---|
|
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.
Prerequisites
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 | ||
---|---|---|
|
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 | ||
---|---|---|
|
- 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:
Parameter | Description |
---|---|
--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/12/pgupgrade.html.
Upgrade PostgreSQL 9.6 to 12
Warning |
---|
Support for PostgreSQL 9.6 is deprecated. You must upgrade to PostgreSQL 12. |
- 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.
- Update the port number and any other settings in the platform configuration.
D s config method triconf - 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 - Make the above changes and save the file.
- Replace all instances of the PostgreSQL port number for the earlier version and replace with the desired port number for the upgrade version.
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 file Path 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
- Start the service:
CentOS/RHEL:
Code Block sudo service postgresql-9.6 start
Ubuntu:
Code Block sudo service postgresql start
When the service restarts, you can check the cluster status using the following script:
Code Block ./analyze_new_cluster.sh
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.D s item item software If all is well, restart the platform. See Start and Stop the Platform in the Install Guide.
Verify and Cleanup
- Verify operations on all databases:
- Login to the application.
- Load a dataset from Flow View.
- Run a job.
- Schedule a job and execute it.
- See Verify Operations in the Admin Guide.
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
- Restart the
. See Start and Stop the Platform in the Install Guide.D s platform