In any upgrade, it is highly recommended that you first upgrade a staging server and confirm that the upgrade process goes smoothly and the upgraded server passes your own acceptance testing before repeating the process to upgrade your production server.
If you need to do any intermediate upgrades to bring your current server to a version that supports upgrade to 24.3, please review the documentation archives for the previous upgrade process to bring your server to version 23.11 prior to following these steps.
Before upgrade, notify your users in advance that the server will be down for a period of time. Consider using a ribbon bar message as part of this notification.
Before upgrading LabKey Server, it is important to upgrade Java, and your database to supported versions. For details see: Supported Technologies
First, locate all the component parts of your existing LabKey Server installation. We provide recommended directory locations, but also use variables like <LABKEY_HOME> and <CATALINA_HOME> to make it easier to follow the documentation no matter where your installation is located.
This topic assumes the following structure, with each of these directories and their contents being owned by the same user that was starting the Tomcat service previously.
Variable | Linux default location | Description |
---|---|---|
LK_ROOT | /labkey | The top level under which all LabKey-related files are nested. |
<LK_ROOT>/src | This is where your current and past LabKey tar.gz installation binaries are saved. | |
<LK_ROOT>/apps | This is a good location for installation of related apps like Java and your database. | |
<LK_ROOT>/backupArchive | This is a good location for storing your own backups, including the backup prior to performing this upgrade. | |
LABKEY_HOME | <LK_ROOT>/labkey i.e. /labkey/labkey | This is where the actual LabKey application is located. |
<LABKEY_HOME>/logs | This location will be created during the first startup of the new server and will hold the logs. | |
<LABKEY_HOME>/labkeywebapp | The directory containing the LabKey Server web application. This location will be created during server startup and thus overwritten at every upgrade. If you have any customizations under this location, you need to move them before this upgrade. | |
<LABKEY_HOME>/modules | The directory containing the LabKey Server modules. This should only contain modules provided to you in the LabKey distribution. Any of your own modules should be in the parallel "externalModules" directory. | |
<LABKEY_HOME>/labkey-tmp | The Tomcat temp directory that LabKey will be using after the upgrade. If your tomcat installation was previously using a different location, you will switch to this location. | |
<LABKEY_HOME>/externalModules | The directory for any additional, user-developed modules you use. You may not need this location. | |
<LABKEY_HOME>/pipeline-lib | This is a legacy directory that is no longer in use. If you have this directory, you can delete it. | |
<LABKEY_HOME>/backup | The automated upgrade process will store the immediate prior backup in this location. This location will be overwritten each time the server starts. If you already have this directory and anything saved in it, move it to <LK_ROOT>\backupArchive before continuing. | |
<LABKEY_HOME>/files OR other file root location(s) | By default, the server's file root is <LABKEY_HOME>/files, though you may be using other file root(s) as well. You can leave files in place during the upgrade, and the server will continue to use the same path(s). Check the site file root from the admin console. |
If you have any modules not provided to you in a LabKey distribution, such as custom modules written by you or someone else in your organization, they should NOT be in the <LABKEY_HOME>/modules directory with the LabKey-distribution modules, but instead in <LABKEY_HOME>/externalModules. The <LABKEY_HOME>/modules directory will be overwritten with each upgrade.
Modules that are in the expected <LABKEY_HOME>/externalModules directory will be automatically seen and loaded when LabKey Server starts. Upgrades will not touch this location.
If you had been using a command line argument to Tomcat to specify a different location for externalModules, you should now move them to the <LABKEY_HOME>/externalModules location with this upgrade.
If you have customized the log4j2.xml file at <LABKEY_HOME>/labkeywebapp/WEB-INF/classes/log4j2.xml, move the custom version to a new location, otherwise it will be overwritten at every upgrade. You will provide the path to the new location in the application.properties file.
If you had previously customized the server's stylesheet, by placing one in the <LABKEY_HOME>/labkeywebapp directory, save it elsewhere before you upgrade. After the upgrade, you should upload your custom stylesheet via the Look and Feel Settings page.
After this upgrade, you will no longer need to install or manage Tomcat yourself. Locate the existing installation so that you can carry forward the necessary configuration:
Variable | Location | Description |
---|---|---|
CATALINA_HOME | Varies. Could be /labkey/tomcat OR /labkey/apps/tomcat OR /labkey/apps/apache/apache-tomcat#.#.##/ | This is where your previous Tomcat version is currently installed. It may be one of the locations to the left or may be somewhere else. All of the following resources will be under this <CATALINA_HOME> location. |
<CATALINA_HOME>/SSL | This is where your existing Java KeyStore is located. You will be moving it to <LABKEY_HOME>/SSL to use after this upgrade. | |
<CATALINA_HOME>/conf | Contains configuration information including the server.xml and/or web.xml files. | |
CONFIG_FILE | <CATALINA_HOME>/conf/Catalina/localhost | The main LabKey configuration file. This will be named either ROOT.xml or labkey.xml, or something similar. |
<CATALINA_HOME>/lib | The existing LabKey Server libraries and JAR files. | |
/etc/default | Configuration files |
Confirm which user was being used to start your Tomcat service (referred to below as the <TOMCAT_USER>). This should not be the root user for security reasons. It might be 'tomcat', 'labkey', or something else, depending on how you originally installed your system.
You will also need to locate your service file and know the configuration of your service and what values are being passed, such as memory, heap dump locations, Java paths, etc. This information may be in one of a few different places. Copy all three of these items and store them in your backupArchive location.
Search Index Note: You may want to find your current installation's full text search index. This previous location might have been <CATALINA_HOME>/temp/labkey_full_text_index or <LK_ROOT>/temp/labkey_full_text_index or similar; use the previous server's UI to locate it if you are not sure. During this upgrade, the new full text search index will be created in <LABKEY_HOME>/files/@labkey_full_text_index. In the cleanup steps after upgrade, you may want to delete the prior index to save disk space.
You do not need to back up the search index.
In the unlikely event that you need to go back to the previous installation of LabKey with Tomcat 9, it will be important to be able to start from the same baseline with more configuration detail than for a usual upgrade. Choose a backup location like <LK_ROOT>/backupArchive/backup2311 in which to store the various files and zip bundles.
1. Download the distribution tar.gz file:
/labkey/src/NAME_OF_DISTRIBUTION.tar.gz
Navigate to that location and unpack the distribution.
sudo tar -xvfz NAME_OF_DISTRIBUTION.tar.gz
It will contain:
Copy the following from the unpacked distribution into <LABKEY_HOME> (i.e. /labkey/labkey):
<LABKEY_HOME>/SSL
If necessary, reassert the <TOMCAT_USER>'s ownership recursively over the entire <LABKEY_HOME> directory. For example, if your <TOMCAT_USER> is 'labkey' and your <LABKEY_HOME> is /labkey/labkey, use:
sudo chown -R labkey:labkey /labkey/labkey
The Tomcat 10 Embedded application requires the <LABKEY_HOME>/config/application.properties to be filled in with values that are unique to your specific LabKey instance and were previously provided in other files or possibly command line options.
A detailed guide to migrating your configuration settings from both your <CONFIG_FILE> and from Tomcat configuration files under <CATALINA_HOME>/conf is provided in this topic:
1. Create the <LABKEY_HOME>/labkey-tmp directory if it does not exist. This location is referenced in the service file. Using our recommended structure, this location is /labkey/labkey/labkey-tmp. If you used another <LABKEY_HOME>, create /labkey-tmp there.
2. Assuming your prior instance was started with a service, confirm the configuration of that service and what values are being passed, such as memory, heap dump locations, Java paths, etc. Locating where these service details were defined was covered in the earlier section about your prior Tomcat configuration.
3. Confirm that you have stored a backup copy of each of these, if they exist:
Stop your existing service, and confirm that Tomcat is no longer running by using the following command:
sudo systemctl status tomcat_lk.service
In the /etc/systemd/system directory:
sudo systemctl daemon-reload
Edit this new "labkey_server.service" file so that it corresponds to your particular instance and all the information gathered in step 2, including but not limited to memory, Java paths, etc. Note: you do not copy full parameter lines like "CATALINA_OPTS" into the new service file. Selectively replace settings in the template we send with the values from your previous configuration.
sudo systemctl daemon-reload
Start your service and then access the <LABKEY_HOME>/logs directory.
If your service did not start as expected, gather additional information about the specific misconfiguration by using these one or both of the following commands:
systemctl status labkey_server.service
journalctl -xe
Once you are confident that the upgrade was successful and you don't have a need to roll back your changes, you can proceed to delete the prior installation of Tomcat 9, i.e. delete the <CATALINA_HOME> directory.
You may also want to delete the prior installation's full text search index, in order to save disk space, though this is not required. We suggested locating it earlier in this topic.
Once you have completed this migration to LabKey Server version 24.3 with embedded Tomcat 10, future upgrades to new releases will be much simpler. You will only need to: