User GuidesAPI ReferenceRelease Notes
Doc HomeHelp CenterLog In
User Guides

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:

  1. Upgrade Tamr Core to v2024.001.1 or greater and take a backup. See Upgrading and Backup .
  2. 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
    
  3. Install the PostgreSQL 15 client. The pg_dumpall command run subsequently uses the newer binaries.
    sudo yum install postgresql15
    
    For detailed PostgreSQL 15.x installation instructions, see Installing Postgres in this guide, or use the procedure outlined in the PostgreSQL YUM Repository.
  4. 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
    
  5. Switch to the postgres user
    sudo su - postgres
    
  6. Run the dumpall command on the Tamr Core database (which has a default name of doit). This creates the dumpfile. The dumpfile contains both postgres and the doit databases.
    pg_dumpall -h localhost -l doit > dumpfile
    
  7. Stop the previously-installed PostgreSQL server.
    sudo systemctl stop postgresql-12
    
  8. Install the PostgreSQL 15 server.
    sudo yum install postgresql15-server
    
  9. 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
    
  10. Restore any previous pg_hba.conf and postgresql.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 for PG_DATA.
  11. 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 = '*'
    
  12. 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
    
  13. Restart the database.
    sudo systemctl restart postgresql-15
    
  14. Log into the upgraded instance of PostgreSQL as a PostgreSQL user and move the dumpfile.
    sudo mv dumpfile /var/lib/pgsql 
    
  15. Make the dumpfile location accessible to the PostgreSQL user.
    sudo chown postgres:postgres /var/lib/pgsql/dumpfile
    
  16. Switch to the PostgreSQL user, and use psql to restore from the dumpfile, as follows. The psql command restores the postgres and doit databases present in the dumpfile. You run it as the postgres user against the postgres database because, when the command starts on the upgraded instance, the Tamr Core functional user and the doit 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
    
  17. 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
    
  18. Start Tamr Core and its dependencies.
    ./start-dependencies.sh
    ./start-unify.sh
    
  19. Run a Tamr Core backup. See Backup .
  20. Optional. Delete the dumpfile.
    sudo rm /var/lib/pgsql/dumpfile
    
  21. Disable the PostgreSQL client for the previous version.
    sudo systemctl disable postgresql-12
    
  22. 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:

  1. Upgrade Tamr Core to v2024.001.1 or greater and take a backup. See Upgrading and Backup .
  2. Stop Tamr Core and its dependencies. See Restarting.
cd /home/ubuntu/tamr
./stop-unify.sh
./stop-dependencies.sh
  1. Confirm that a single PostgreSQL cluster with the current version exists.
sudo pg_lsclusters
  1. Install the PostgreSQL client version 15.
sudo apt install postgresql-15 postgresql-client-15
  1. List PostgreSQL clusters.
sudo pg_lsclusters

You should see two clusters running, with PostgreSQL versions 12 and 15.

  1. Drop the PostgreSQL 15 cluster and stop it.
sudo pg_dropcluster 15 main --stop 
  1. List PostgreSQL clusters to verify that now the PostgreSQL 12 cluster is running.
sudo pg_lsclusters
  1. Upgrade the 12 cluster to PostgreSQL version 15.
sudo pg_upgradecluster -v 15 12 main
  1. 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
  1. Verify that PostgreSQL 15 is installed.
sudo psql --version
  1. Restore any previous pg_hba.conf and postgresql.conf modifications. Compare etc/postgresql/12/main/pg_hba.conf and etc/postgresql/15/main/pg_hba.conf and restore any non-default location for PG_DATA.

  2. 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 = '*'
  1. 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
  1. 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
  1. Start Tamr Core and its dependencies. See Upgrading.
./start-dependencies.sh
./start-unify.sh
  1. Run the Tamr Core backup. See Backup .
  2. 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