Upgrade batch script for manually installed Windows Servers

Administration Forum (Inactive)
Upgrade batch script for manually installed Windows Servers Brian Connolly  2011-01-24 17:03
 

Overview

Sample Script: upgrade-windows-manual.bat

This sample script is used internally for upgrading a LabKey Server that was manually installed on Windows. On Windows, there are two methods to install the LabKey Server. The first is to use the configWindows. The second is perform a manualInstall This script can be used when upgrading a LabKey Server on Windows which was installed manually only. This script should never be used to upgrade a LabKey Server that was installed using the configWindows.

This is a very simple script, but with a little customization, as described below, you should be able to quickly start using it for your LabKey Server installation.

How to customize the script

Nearly all script customization can be done by changing the variables at the beginning of the script. Below is a description of each variable.

  • labkey_home: This is the installation directory for the LabKey Server. This directory contains the labkeywebapp and modules directory among others. For many customers this is set to /usr/local/labkey
  • labkey_distdir: This is the directory which will hold the uncompressed LabKey distribution directories. For example:
    • If you downloaded the current LabKey distribution (LabKeyxx.x-xxxxx-xx-bin.zip, where "xx.x-xxxxx-xx" represents the current version number) into h:\labkey\dist
    • Then uncompressed the distribution file into h:\labkey\dist\LabKeyxx.x-xxxxx-xx-bin using a command similar to
cd h:\labkey\dist and 
unzip LabKeyxx.x-xxxxx-xx-bin.zip
    • Then the labkey_distdir should be set to h:labkeydist
  • catalina_home: This is the installation directory for the Tomcat Server
Other important information
  • Tomcat Windows Service: This script assumes that the Tomcat Windows service is called *Apache Tomcat*. If the Tomcat Windows service on your server is named something different, please make the change in the script.

How to use this script

After you have customized this script, you can execute the script by running the following from a command prompt:
upgrade-windows-manual.bat DIST
where DIST is the directory containing the uncompressed LabKey Server distribution files. If we use the example above (in the description for *labkey_distdir* variable), then the command line should be:
upgrade-windows-manual.bat LabKeyxx.x-xxxxx-xx-bin

Additional Notes

Roll back to previous version:

  • This script does not keep a backup copy of the LabKey Server java files before the upgrade. In order to install a previous version, you will need to have the LabKey Distribution files available on your file system.
  • You can then simply execute the script again specifying the previous versions directory containing the uncompressed LabKey Server distribution files
Backup of LabKey Server database:
  • This script does not perform a backup of your LabKey Server database.
    • LabKey recommends that you perform a backup of your LabKey Server database before upgrading your LabKey Server using this script.
    • See dbBackup and backupScenarios for more information on backing up your database.