How to manually update major PostgreSQL versions (Mac)

PokerTracker 4 version 4.15.13
August 16, 2021
  • 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 8.4 to 9.6 or 9.3 to 9.6, 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.

    Anyone who is using PostgreSQL 8.4 or earlier and is considering updating to Mac OS X 10.15 (Catalina) will NEED to upgrade to a 64-bit PostgreSQL version (9.0 or later) before updating to Catalina, as this OS X update will prevent 32-bit bit applications from running.

  • Overview

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

    1. Backup your databases (using the old PostgreSQL service)
    2. Install the new PostgreSQL version
    3. Configure PT4 to use the new PostgreSQL version
    4. Restore your databases using the new PostgreSQL version

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

    This is all that is required, but once you have your databases working in the new PostgreSQL version and are confident that you have all your data you may want to uninstall the old PostgreSQL version and delete the old databases to recover the disk space.

  • 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.

    You can also see the port number being used in the list of databases.

    If you're not able to run PT4 then you can check the PostgreSQL version as described here.

  • 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.

  • Install new PostgreSQL version

    At the time of writing our recommended PostgreSQL version is v9.6.

    Please visit this page to download the installer for the current 9.6.x version for Mac OS X.

    If you have an older version of mac OSX which does not support v9.6 then you can install v9.3 instead.

    Once it has downloaded, run the installer and follow the steps to install.
    Set the password to 'dbpass' (no quotes) to match what PT4 uses, and make a note of the port number used.

    For more information about installing PostgreSQL manually see this guide.

  • Configure PokerTracker 4 to use new PostgreSQL service

    To configure PokerTracker 4 to use the new PostgreSQL version we need to edit the configuration file to enter the port number that you noted during the installation in the previous step.

    To do that open a Finder window and go to ~/Library/Application Support/PokerTracker 4/Config.  (In Finder, press Cmd-Shift-g and type or paste in this path.)
    Double click PokerTracker.cfg, click Choose Application and select TextEdit.

    Find the section labelled [Database], which should be near the start of the file.
    Edit the following line to change the port number to the one set when you installed the new PostgreSQL version:

    Default.Postgres.Port=5432

    Most likely the new port number will be:

    Default.Postgres.Port=5433

    Press Cmd-s to save the change, and Quit TextEdit.

    To confirm the change run PT4 and go to Database > Database Management in the menu.  You should see the new PostgreSQL version number (v9.6.x) listed in the bottom right corner.

    Ensure that you see the new PostgreSQL version here before proceeding.

  • Restore your databases to the new PostgreSQL service

    Now that we have the new PostgreSQL version installed and configured for use in PokerTracker 4 we can restore the backed-up databases.

    Run PokerTracker 4 and go to File > Restore in the menu.

    Select your backup file and click Open, then click Restore Now.

    (If you made separate backups of multiple databases, repeat this step for each backup.)

    For large databases this will take some time so please be sure to run it when you have time to let it complete.

  • Set the new default database in PokerTracker 4

    When you have restored your databases, you can use Database > Database Management to set the default database for PT4 to use from now on.

    Select your preferred database and click the Set Default button.
    The default database is the one which will be Active when first opening PT4.

    Tip!  The restored databases will have the same names as the originals, but a different port number, and will be shown at the bottom of the list by default.

  • Uninstall old PostgreSQL version

    Uninstalling the old PostgreSQL version and deleting the old databases is not required, and we recommend that you do NOT do this until you are absolutely sure that everything is working as expected with the upgraded databases and you have all of your data.

    Once you are sure that everything is upgraded and working properly you can recover some hard disk space by removing the old PostgreSQL version and old databases.

    Please read the guide How to Uninstall/Reinstall PostgreSQL (Mac) for directions, and be sure to only remove the old PostgreSQL version.

    PokerTracker 4 will not know that the old databases were removed and will still list them in Database > Database Management.  To remove them from this list select the old databases one at a time and click the Remove button.

     

  • Contact Support

    If you have questions regarding any of these steps or if you have performed the steps in this guide but are having trouble then please contact our friendly technical support team.

    In your support message, please provide us with the following information so that we can provide assistance as quickly as possible:

    1. State that you are following the "How to manually update major PostgreSQL Versions (Mac) Guide" and (have a question or are having trouble).
    2. If you are having trouble, please provide us with each step that you performed and which step that is causing you problems.
    3. State exactly the problem that you are experiencing.

    Tip: Screenshots of your problem and/or showing which steps that you have performed are a bonus and will help us more clearly understand the issue and ultimately resolve the problem faster.