Upgrading PostgreSQL
Upgrade to PostgreSQL 15 using the procedures in this section.
As of the v2024.001.1 release, Tamr Core supports both PostgreSQL v15 or v12. To ensure your installation has the latest bug and security fixes, install or upgrade to the latest minor version of PostgreSQL 15 .
This topic provides upgrade instructions for the following single-node deployments in which PostgreSQL is installed on the same server as Tamr Core.
For assistance upgrading PostgreSQL in a cloud-native, scalable AWS deployment or in AWS deployments in which PostgreSQL is installed on a separate AWS RDS Postgres instance, contact Tamr Support ([email protected]).
Upgrading PostgreSQL on Same Server as Tamr Core
Upgrading PostgreSQL to Version 15 on RHEL
These instructions rely on PostgreSQL instructions for upgrading using dumpall
. This method allows you to dump data from one major version of PostgreSQL and reload it in another. You must use a logical backup utility, pg_dumpall
, and not the system backup. For more information, see Upgrading Postgres with Dumpall in the PostgreSQL v15.x documentation.
The commands in this procedure assume that PostgreSQL version 12 is your current PostgreSQL version. If the current version is not 12, change the commands appropriately.
To upgrade to PostgreSQL 15 on RHEL:
- Upgrade Tamr Core to v2024.001.1 or greater and take a backup. See Upgrading and Backup .
- Stop Tamr Core and its dependencies. Use the following commands or see Restarting.
sudo su - <tamr-functional-user> cd <tamr-home-directory>/tamr ./stop-unify.sh ./stop-dependencies.sh
- Install the PostgreSQL 15 client. The
pg_dumpall
command run subsequently uses the newer binaries.For detailed PostgreSQL 15.x installation instructions, see Installing Postgres in this guide, or use the procedure outlined in the PostgreSQL YUM Repository.sudo yum install postgresql15
- Optional. Write the Tamr Core PostgreSQL user password
<tamr-postgres-user-password>
to a local hidden file and change permissions to avoid prompting for the password.sudo echo "localhost:5432:*:tamr:<tamr-postgres-user-password>" > .pgpass sudo chmod 600 .pgpass
- Switch to the
postgres
usersudo su - postgres
- Run the
dumpall
command on the Tamr Core database (which has a default name ofdoit
). This creates thedumpfile
. Thedumpfile
contains bothpostgres
and thedoit
databases.pg_dumpall -h localhost -l doit > dumpfile
- Stop the previously-installed PostgreSQL server.
sudo systemctl stop postgresql-12
- Install the PostgreSQL 15 server.
sudo yum install postgresql15-server
- Initialize the new version of PostgreSQL client and enable an automatic start.
sudo /usr/pgsql-12/bin/postgresql-15-setup initdb sudo systemctl enable postgresql-15 sudo systemctl start postgresql-15
- Restore any previous
pg_hba.conf
andpostgresql.conf
modifications. Compare/var/lib/pgsql/12/data/pg_hba.conf
and/var/lib/pgsql/15/data/pg_hba.conf
and restore any non-default location forPG_DATA
. - Open
postgresql.conf
and add an entry to it as follows, to make the PostgreSQL instance listen on all addresses, and not only on the loopback address. Save the file.listen_addresses = '*'
- Open the
postgresql.conf
again and confirm that the port for PostgreSQL is specified correctly as 5432.
By default, PostgreSQL 15 binds the port 5432 after an upgrade when it takes over from PostgreSQL 12 or earlier. However, your instance of PostgreSQL 15 may not be configured to use port 5432 after restart. This may happen if the port 5432 is taken by the instance with the previous version of PostgreSQL before that instance is dropped.port = 5432
- Restart the database.
sudo systemctl restart postgresql-15
- Log into the upgraded instance of PostgreSQL as a PostgreSQL user and move the
dumpfile
.sudo mv dumpfile /var/lib/pgsql
- Make the
dumpfile
location accessible to the PostgreSQL user.sudo chown postgres:postgres /var/lib/pgsql/dumpfile
- Switch to the PostgreSQL user, and use
psql
to restore from thedumpfile
, as follows. Thepsql
command restores the postgres and doit databases present in thedumpfile
. You run it as thepostgres
user against thepostgres
database because, when the command starts on the upgraded instance, the Tamr Core functional user and thedoit
database do not yet exist on the instance. They are created during the restore process.sudo su - postgres psql -f /var/lib/pgsql/dumpfile logout
- Verify that Tamr Core can connect to its database in this instance of PostgreSQL. The default Tamr Core database name is
doit
.psql -h localhost -U tamr -d doit
- Start Tamr Core and its dependencies.
./start-dependencies.sh ./start-unify.sh
- Run a Tamr Core backup. See Backup .
- Optional. Delete the
dumpfile
.sudo rm /var/lib/pgsql/dumpfile
- Disable the PostgreSQL client for the previous version.
sudo systemctl disable postgresql-12
- Optional: Uninstall the PostgreSQL client for the previous version. This step is recommended to avoid unintentional initialization of the previous version; however, it should only be performed if the previous version is not being used by any other applications.
sudo yum remove postgresql12
Upgrading PostgreSQL to Version 15 on Ubuntu
The commands in this procedure assume that PostgreSQL version 12 is your current PostgreSQL version. If the current version is not 12, change the commands appropriately.
To upgrade to PostgreSQL 15 on Ubuntu:
- Upgrade Tamr Core to v2024.001.1 or greater and take a backup. See Upgrading and Backup .
- Stop Tamr Core and its dependencies. See Restarting.
cd /home/ubuntu/tamr
./stop-unify.sh
./stop-dependencies.sh
- Confirm that a single PostgreSQL cluster with the current version exists.
sudo pg_lsclusters
- Install the PostgreSQL client version 15.
sudo apt install postgresql-15 postgresql-client-15
- List PostgreSQL clusters.
sudo pg_lsclusters
You should see two clusters running, with PostgreSQL versions 12 and 15.
- Drop the PostgreSQL 15 cluster and stop it.
sudo pg_dropcluster 15 main --stop
- List PostgreSQL clusters to verify that now the PostgreSQL 12 cluster is running.
sudo pg_lsclusters
- Upgrade the 12 cluster to PostgreSQL version 15.
sudo pg_upgradecluster -v 15 12 main
- List PostgreSQL clusters to verify that the PostgreSQL cluster with version 12 is present but stopped, and the PostgreSQL cluster with version 15 is running.
sudo pg_lsclusters
- Verify that PostgreSQL 15 is installed.
sudo psql --version
-
Restore any previous
pg_hba.conf
andpostgresql.conf
modifications. Compareetc/postgresql/12/main/pg_hba.conf
andetc/postgresql/15/main/pg_hba.conf
and restore any non-default location forPG_DATA
. -
Open
postgresql.conf
and add an entry to it as follows, to make the PostgreSQL instance listen on all addresses, and not only on the loopback address. Save the file.
listen_addresses = '*'
- Open the
postgresql.conf
again and confirm that the port for PostgreSQL is specified correctly as 5432.
By default, PostgreSQL 15 binds the port 5432 after an upgrade when it takes over from PostgreSQL 12 or earlier. However, your instance of PostgreSQL 15 may not be configured to use port 5432 after restart. This may happen if the port 5432 is taken by the instance with the previous version of Postgres before that instance is dropped.
port = 5432
- Verify that Tamr Core can connect to its database in this instance of PostgreSQL. The default database name is
doit
.
sudo psql -h localhost -U tamr -l doit
- Start Tamr Core and its dependencies. See Upgrading.
./start-dependencies.sh
./start-unify.sh
- Run the Tamr Core backup. See Backup .
- Optional. Drop the PostgreSQL cluster for the previous version. This step is recommended to avoid unintentional initialization of the previous version; however, it should only be performed if the previous version is not being used by any other applications.
sudo pg_dropcluster 12 main
Updated 9 days ago