Upgrade Monitor Using the Online Database Method on Windows

Before starting, check if a license update if needed. Consider the following:
  • If using a keyfile license, no license upgrade is needed.
  • If using an RLM license, switch to an ALM license model
Note: If setting the environment variable is confusing, just capture the folder path and location and make a note of it.
An overview of this process:
  1. Backup the current database.
  2. Upgrade the backup database.
  3. Switch the backup database as the production database.
Be sure to provide a meaningful folder name where the backup database resides. For example:
set BACKUP=/big/DBBACKUP
For example, /big/DB_14
  1. Set LM_NAME to the Monitor project name and enable the shell.
    % set LM_NAME=licmon
    % vovproject enable %LM_NAME%
    % vovserverdir -p
    % set SWD=%<_the_return_value_of_above_command%
    

    For example:

    % set SWD=C:\altair\swd\licmon.swd
  2. Set more environment variables that will be used later. OLDVOVDIR is the value of VOVDIR from the current software version, and NEWVOVDIR is the value of VOVDIR from the new software version. For example:
    % set OLDVOVDIR=C:\altair\lm_2210\win64
    % set NEWVOVDIR=C:\altair\lm_2311\win64  (upgrade to v2023.1.1)
  3. Record the location of the database for later removal.
    vovdb_util showcfg

    For example:

    vovdb_util 08/14/2023 15:27:15: message: The VOV database configuration is:
    vovdb_util 08/14/2023 15:27:15:   Host:       localhost
    vovdb_util 08/14/2023 15:27:15:   Port:       37204
    vovdb_util 08/14/2023 15:27:15:   Data Path:  C:/altair/db/lm_2210_3  <<<<<<<<<<<<<< used this path in next step
    vovdb_util 08/14/2023 15:27:15:   Status:     ready
    vovdb_util 08/14/2023 15:27:15:   AutoBackup: enable 0 period 604800 root {} startFrom 1 startTo 4 keep 3
  4. Store the path in ORIGPATH.
    % set ORIGPATH=C:/altair/db/lm_2210_3
  5. Create PG 9.X database backup.
    % set BACKUP=/big/DBBACKUP

    For example:

    % set BACKUP=C:\altair\DBBACKUP
  6. Choose the location and set the BACKUP variable. This step runs at disk copy speed. (Be sure to use a meaningful folder name.)
    % vovdb_util backup %BACKUP%

    For example:

    vovdb_util backup C:\altair\DBBACKUP 
    vovdb_util 08/14/2023 15:32:58: message: Backing up the database to 'C:\altair\DBBACKUP'...
    pg_basebackup: initiating base backup, waiting for checkpoint to complete
    pg_basebackup: checkpoint completed
    transaction log start point: 0/3000028 on timeline 1
    pg_basebackup: starting background WAL receiver
    39861/39861 kB (100%), 1/1 tablespace
    transaction log end point: 0/3007148
    pg_basebackup: waiting for background process to finish streaming ...
    pg_basebackup: base backup completed
    vovdb_util 08/14/2023 15:33:06: message: Database backed up.
  7. Source the vovinit.bat file to access the newly installed software:
    % $NEWVOVDIR\bat\vovinit.bat

    For example:

    C:\altair\lm_2311\win64\bat\vovinit.bat
  8. Verify the environment version:
    % vovversion

    For example:

    %  C:\Users\jlin>vovversion
    2023.1.1
  9. Export the PG 9.X database passwords using a version of the Accelerator software (2023.1.0 or higher) that supports the exportpasswords subcommand.
    vovdb_util exportpasswords $SWD\PASSWORD_FILE

    For example:

    % vovdb_util exportpasswords C:\altair\licmon\licmon2.swd\PASSWORD_FILE
    vovdb_util 08/14/2023 16:18:48: message: Database passwords exported to: C:\altair\licmon\licmon2.swd\PASSWORD_FILE
  10. Create a new Monitor converter project that will be used to convert the older PG database to a version 14.4 database.
    % set LM_CONVERTER=lm_temp_project (may skip)
    
    % $NEWVOVDIR\bat\vovinit.bat
    For example:
    C:\altair\lm_2311\win64\bat\vovinit.bat

Steps 11 - 17 will target the Monitor $LM_CONVERTER project.

  1. Configure the backed-up database for use in this new project.
    % lmmgr start -name lm_temp_project -port any:1 -webport any:2 -roport 0 -inport any:3 -upport any:4
    For example:
    lmmgr start -name lm_temp_project -port any:1 -webport any:2 -roport 0 -inport any:3 -upport any:4
    lmmgr 08/14/2023 16:40:57: message: Starting Monitor instance lm_temp_project
    ...
  2. Run the following commands:
    % vovproject enable lm_temp_project
    
    % hostname
    % vovdb_util configure -noconfirm `hostname -s` %BACKUP%
    For example:
    % vovdb_util configure -noconfirm sdc-win19csg-1 C:\altair\DBBACKUP 
  3. Check the path, which is the postgres bin\ folder of the current release. For example:
    C:\altair\lm_2210\win64\postgresql9_6\bin
  4. Convert database PG 9.X to PG 14.4. This will operate at about 1/2 of disk-copy speed.
    % vovdb_util importpasswords $SWD/PASSWORD_FILE
    For example:
    vovdb_util importpasswords C:\altair\licmon\licmon2.swd\PASSWORD_FILE
  5. Run the following commands:
    vovdb_util upgrade -sdb "C:\altair\DBBACKUP\dbdata9_6" -spgsw "C:\altair\lm_2210\win64\postgresql9_6\bin"
    For example:
    vovdb_util upgrade -sdb C:\altair\DBBACKUP\dbdata9_6 -spgsw C:\altair\lm_2210\win64\postgresql9_6\bin
    vovdb_util 08/15/2023 10:38:19: message:     sourceVer: 9_6
    vovdb_util 08/15/2023 10:38:19: message:     targetVer: 14_4
    vovdb_util 08/15/2023 10:38:19: message: Preparing to upgrade VOV database to version 14.4:
    vovdb_util 08/15/2023 10:38:19:              Source Dir: C:\altair\DBBACKUP\dbdata9_6
    vovdb_util 08/15/2023 10:38:19:                 Version: 9.6
    vovdb_util 08/15/2023 10:38:19:              Target Dir: C:/altair/DBBACKUP/dbdata14_4
    vovdb_util 08/15/2023 10:38:19:                 Version: 14.4
    vovdb_util 08/15/2023 10:38:19:
    vovdb_util 08/15/2023 10:38:19: The upgrade process creates a copy of the database for use with the new
    version of PostgreSQL.  There must be free disk space greater than the size of
    the current database.  The original files will remain after the upgrade, but
    may be deleted at any time to reclaim disk space.
    vovdb_util 08/15/2023 10:38:19:
    Upgrade database (yes/no)? yes
    vovdb_util 08/15/2023 10:38:35: message: Proceeding with upgrade.
    vovdb_util 08/15/2023 10:38:35: message: Configuration of upgrade
    ...
  6. After the database is converted, shut down the Monitor converter project:
    % lmmgr stop -name $LM_CONVERTER -force
    For example:
    lmmgr stop -name lm_temp_project
  7. Wait for at least 5 seconds before shutting down the database. Then run:
    % vovproject destroy -force $LM_CONVERTER
    For example:
    vovproject destroy -force lm_temp_project
    vovproject 08/15/2023 10:55:22: message: Deleting c:/altair/licmon/lm_temp_project.swd/
    vovproject 08/15/2023 10:55:22: message: Deleting registry entry C:/altair/lm_2311/win64/local/registry/jlin/lm_temp_project@sdc-win19csg-1
    vovproject 08/15/2023 10:55:22: message: Deleting C:/altair/lm_2311/win64/local/registry/system-lm/lm_temp_project.reg

The remainder of the procedure will target the production Monitor project - $LM_NAME.

  1. Shut down the Monitor project and disable the database so it does not come up initially after restart:
    1. Run:
      % $OLDVOVDIR\bat\vovinit.bat
      For example:
      C:\altair\lm_2210\win64\bat\vovinit.bat
    2. Run:
      % vovproject enable $LM_NAME
      For example:
      vovproject enable licmon2
    3. Run:
      % vovdb_util stopdb
      For example:
      vovdb_util stopdb
      vovdb_util 08/15/2023 11:15:09: message: Stopping database...
      vovdb_util 08/15/2023 11:15:10: message: Database stopped.
    4. Run:
      % lmmgr stop -name $LM_NAME -force
      For example:
      lmmgr stop -name licmon2 -force
      lmmgr 08/15/2023 11:16:33: message: Stopping LicenseMonitor project licmon2...
      vovproject 08/15/2023 11:16:34: message: Checking privilege to stop project 'licmon2'
      vovproject 08/15/2023 11:16:34: message: Stopping all retracing
      vovstop 08/15/2023 11:16:34: msg-1: No retrace to stop
      vovproject 08/15/2023 11:16:34: message: Retracing stopped
      vovproject 08/15/2023 11:16:35: message: Stopping all daemons in licmon2
      vovresourced             STOPPING ...
      vovdbd                   STOPPING ...
      ...
  2. Upgrade the production Monitor project with start and new Monitor software version by running the following commands:
    1. Wait for at least 5 seconds, and then initialize the new directory:
      % $NEWVOVDIR\bat\vovinit.bat
      For example:
      C:\altair\lm_2311\win64\bat\vovinit.bat
    2. Verify the version:
      % vovversion
      For example:
      vovversion
      2023.1.1
    3. Start a Monitor instance:
      % lmmgr start -name $LM_NAME
      For example:
      lmmgr start -name licmon2
      lmmgr 08/15/2023 11:19:45: message: Starting Monitor instance licmon2
      lmmgr 08/15/2023 11:19:45: message: Updating autostart/start_vovnotifyd.tcl...
      lmmgr 08/15/2023 11:19:45: message: Updating autostart/start_vovlmd.tcl...
      ...
    4. Enable the Monitor project:
      % vovproject enable $LM_NAME
      For example:
      vovproject enable licmon2
      vovproject 08/15/2023 11:20:55: message: Enabling project 'licmon2'...
  3. Configure the location of the PG 14.4 database, then start the database.
    vovdb_util configure -reset -noconfirm `hostname -s` $BACKUP
    For example:
    vovdb_util configure -reset -noconfirm sdc-win19csg-1 C:\altair\DBBACKUP
    vovdb_util 08/15/2023 11:24:02: message: Configuration saved.
  4. Wait for a few seconds, then restart the database:
    % vovdb_util startdb
    For example:
    vovdb_util startdb
    vovdb_util 08/15/2023 11:25:03: message: Starting database...
    vovdb_util 08/15/2023 11:25:04: message: Checking user privileges
    vovdb_util 08/15/2023 11:25:04: message: User is not admin or service.
    vovdb_util 08/15/2023 11:25:04: message: Starting database
    vovdb_util 08/15/2023 11:25:04: message: LOG:  starting PostgreSQL 14.4, compiled by Visual C++ build 1914, 64-bit
    vovdb_util 08/15/2023 11:25:04: message: LOG:  listening on IPv6 address "::", port 37204
    ...
    
    
                    
  5. In the Monitor web portal, click Admin > System > Database Information. Scroll to the bottom of the page and verify the Engine Version displays 14.4.
  6. Load checkouts that occurred since the time of the backup.
    % lmmgr loaddb -v
    For example:
    lmmgr loaddb -v
    lmmgr 08/15/2023 11:30:11: message: Loading all data files into the database...
    lmmgr 08/15/2023 11:30:12: message: Load all checkouts that come from sampling
    ...
  7. Remove the two extra database copies; for example backup db /big/DBBACKUP/pgdata9_6 and the original C:/altair/db/lm_2210_3/datadb9_6 project db.