How to manually update PostgreSQL

PokerTracker 4 version 4.15.34
April 26, 2024
  • Introduction

    This guide is intended for users who need to manually upgrade to a different major version of PostgreSQL.

    Tip!  This only applies when upgrading between major versions like 9.3 to 9.6, or 9.3 to 10, for example.  Minor version updates like 9.6.x to 9.6.y do not need to follow this process as that does not require a database update.

  • Overview

    The upgrade process consists of the following steps, which are detailed below.

    1. Backup your databases (using the old PostgreSQL service)
    2. Uninstall the old PostgreSQL service
    3. Install the new PostgreSQL version
    4. Restore your databases (using the new PostgreSQL service)

    Please note that if you have large databases this will take a considerable amount of time, so please schedule it when you have time to complete the process.

  • How to check what PostgreSQL version PT4 is using

    The easiest way to check which PostgreSQL version PokerTracker 4 is using is by going to Database > Database Management in the PT4 menu.

    In the Database Management window the current PostgreSQL version is shown in the bottom right corner.
    This the version you will later uninstall, after making a backup.

    You can also see the port number being used in the list of databases.
    Make a note of this.  You will use the same port number when installing the new PostgreSQL version.

    If you are not able to run PT4 then you can check the PostgreSQL version as described here for Windows or here for macOS.


  • Backup your databases using the old PostgreSQL service

    The first step is to make a backup of all of your PokerTracker 4 databases.

    This can be done within PT4 by going to File > Backup in the menu.

    For more information about the Backup and Restore processes please see this guide.

    In this case we need to back up all of the databases, but no other files.
    (We recommend performing regular backups including the Optional Files, but that is not required here and can add some time to the process.)

    To do this:

    • Remove all the checkmarks in the Optional Files section.
    • Make sure that Backup Databases is checked.
    • Turn on the checkmarks next to all databases on the left.


    Tip!  If you have multiple large databases you may prefer to make individual backups of each database separately.  This will generate more manageable sized backup files, and allow you to split up the process so that you can use PT4 in between making each backup.

    Ensure that the backup completes successfully before proceeding.

  • Uninstall the old PostgreSQL version

    Once you have a backup of your PT4 databases you can uninstall the old PostgreSQL version.

    • Uninstall PostgreSQL on Windows

      To uninstall the old PostgreSQL service on Windows, navigate to Apps & features in Control Panel.

      Click the Start button in Windows and type 'remove', and select Add or remove programs to access Apps & features.

      Find PostgreSQL 9.3 (or whatever version you currently have installed) in the list and click to select it.
      Click on Uninstall and follow the prompts to complete the uninstall process.

    • Uninstall PostgreSQL on macOS

      To uninstall the old PostgreSQL service on macOS follow these directions.

      1. Open a Finder window and select Go > Go to Folder from the menu.
      2. Navigate to /Library/PostgreSQL/9.3, where 9.3 is your current PostgreSQL version number.
      3. Open the uninstall-postgresql app, and enter your macOS administrator password if required.
      4. Follow the prompts to uninstall PostgreSQL.
    • Old PostgreSQL data folder

      The PostgreSQL data directory will not be removed by the uninstall process.

      We suggest that you do not delete this folder until you have everything set up and working in the new PostgreSQL service, as this will allow you to recover your old databases if you encounter any problems along the way.

      Click here for information on how to delete the data folder, or how to use it if you need to recover your old PostgreSQL version.

  • Install the new PostgreSQL version

    PokerTracker 4.18 supports up to PostgreSQL version 16.

    The maximum PostgreSQL version supported by PokerTracker up to v4.17.15 is PostgreSQL 12.x

    Please visit this page to download the appropriate PostgreSQL 16.x installer for your computer.

    The latest PostgreSQL version that supports 32-bit Windows computers is PostgreSQL 10.  If your PC is 32-bit then you will need to download PostgreSQL 10.x instead.

    Tip!  To check whether your Windows PC is 64-bit or 32-bit select the Start button > Settings > System > About.  Under Device specifications > System type, see if you're running a 32-bit or 64-bit version of Windows.

    Once the installer has downloaded, run it.

    You can click 'Next' through most of the steps, but:

    • On the Select Components page de-select 'Stack Builder'.
    • On the Password page enter 'dbpass' as the password.
    • On the Port page the port number should default to the same port number shown in your PT4 Database Management window that you noted earlier, and you should edit it to match if it does not.  This is most likely 5432.
  • Restore your databases to the new PostgreSQL service

    Once the new PostgreSQL version is installed run PokerTracker 4 again.

    When PT4 starts up it will not be able to connect to your databases, and the following window will be shown.

    Click New to create a temporary database.
    The name used isn't important as you can delete this database again after your own databases have been restored - just click Create.
    Once the new database is created PT4 will start up.

    To restore your databases follow these steps:

    1. Go to File > Restore
    2. Select the backup file you made earlier, and click Open
      If your backup includes any Optional Files disable those options.  You only need to restore the databases here.
    3. Click Restore Now
    4. Wait for the process to complete and then close the Restore window
    5. Open Database > Database Management
    6. Select your main database and click Set Active, and Set Default
    7. Select the temporary database and click Delete

    If you made a separate backup for each database, you may repeat steps 1 to 4 to restore the remaining databases at any time.

    • Re-Import instead of Restore (optional)

      The normal method is to Restore your backed up database, as described above.

      However, an alternative method is to re-import your original hand histories to a new database instead.

      This may lead to more accurate data if any of your hands were affected by import issues when originally imported.

      When restoring, the whole database restore needs to be done as a single operation and if you have a large database this could take a considerable amount of time.

      Re-importing all your hands instead will take longer overall, but can be done in smaller sections if you want to break it up to allow you to use PT4 again more quickly.

      If you have any manual notes in your database, or if you manually edited any tournament results, then restoring the database backup will retain your changes, where re-importing will not.

  • Deleting the data folder for the old PostgreSQL version

    When you uninstall the old PostgreSQL service the data folder is not automatically deleted.
    We recommend that you do not delete this folder until you have fully restored your databases in the new PostgreSQL service and have confirmed that everything is working correctly.

    If you experience a problem during the upgrade process and are unable to access your databases in the new PostgreSQL service you can download and install the old PostgreSQL version that you were originally using from this page, and that should allow PT4 to access your old databases again.  Please contact support if you need help with this.

    Once you have confirmed that your databases are working correctly in the new PostgreSQL service you may wish to delete the data folder from the old PostgreSQL service to free up the disk space.

    On Windows the folder will be something like C:\Program Files\PostgreSQL\9.3\data

    On macOS the folder will be something like /Library/PostgreSQL/9.3/data

    "9.3" is the version number of the old PostgreSQL service, and may be different depending on the version number of your old PostgreSQL service.

    Take care to only delete this folder from your old PostgreSQL service.

    If there are any other files or folders alongside the data folder then that PostgreSQL version is still installed and you should not delete anything.