upgrade.sh script supplied with each new release to upgrade your system.
You must upgrade to each version in turn. This ensures that any data migration required by each upgrade is completed successfully before you begin the upgrade to the next version. This does not include patch versions so, for example, you can upgrade from any version of 1.18 to any version of 1.19.
If you have made any manual changes to the configuration of LGTM, beyond editing the cluster configuration file, upgrading may overwrite these changes. We recommend that you back up your system before upgrading.
Before proceeding with an upgrade, read the relevant "points to note" section below. When you're ready to upgrade, run the script on the coordinator server, as described in the Upgrade process section below. When you run the script, you will be prompted to perform any required actions on remote servers.
For information about the servers referred to in this topic, see Server overview.
All repository providers, other than those for Subversion and simple Git, must now specify a user name and password. This was strongly recommended in version 1.18 of LGTM Enterprise, but is now mandatory in 1.19.
After upgrading you must ensure that the settings for all repository providers (except Subversion and simple Git) include a valid user name and password. Check the
The account is used by LGTM Enterprise:
to determine a variety of metadata about repositories—for example, whether the repository name has changed
- to post comments and set statuses on the pull requests of projects for which automated code review integration has been set up
For more information about repository providers, see Adding repository providers.
Points to note for upgrading from 1.17 to 1.18
After you upgrade to 1.18
After upgrading to 1.18, you should make the following changes:
Define accounts for repository providers—this release adds user account fields to the configuration forms for all external repository providers. Specifying user account details is optional in this release but is strongly advised, and is mandatory in 1.19. Doing so ensures that LGTM will analyze the correct code for a project following a rename or a change to the clone protocol or default branch. For more information, see Adding external repository providers.
Update links to LGTM Enterprise logs—the URL for job logs has changed in this release. A
jobsdirectory has been added to the URL. Any saved links containing paths such as
/admin/logs/3504840010should be updated to add
https://<LGTM-server>/admin/logs/jobs/3504840010/stdout. A URL redirection in this release ensures that links that use the old path will still work for now. However, this redirection will be removed at the next release so it's a good idea to advise users to update any links they have saved now.
- Make the 1.18 IDE plugins available to users—from 1.17.1 onward, the LGTM IDE plugins use a new method to authorize access to LGTM Enterprise. Users can only download alerts from LGTM 1.18 if they upgrade to at least version 1.17.1 of the plugin.
Points to note for upgrading from 1.16 to 1.17
Before you upgrade to 1.17
Before you upgrade from 1.16.x to 1.17.x, you should consider the following changes:
- Export of business intelligence (BI) data will stop—there is a new database format for 1.17.
- Dedicated search service is required—this was introduced in 1.16. If you originally installed 1.15 and have not enabled this service manually, you'll be prompted to do this as part of the upgrade.
If your system is set to export LGTM data to a database, this is automatically disabled by upgrading to 1.17. After upgrading you need to prepare a database before you restart export.
After you upgrade to 1.17
After upgrading to 1.17, you may want to make the following changes:
- Configure an empty database and re-enable BI export—if you export data from LGTM for use with BI tools, you need to make an empty database available for the new data and set up BI export in the administration pages of the application.
For more information, see Re-exporting BI data from scratch.
- Add on-demand workers—consider updating the cluster configuration to include some of the new
on_demandworkers. For more information, see Worker types.
- Configure workers for Team Foundation Version Control (TFVC) analysis—if your organization stores code in TFVC repositories, you may want to configure some or all of the worker hosts to checkout code from these repositories. For more information, see Installing a command-line client for TFVC.
Points to note for upgrading from 1.15 to 1.16
Before you upgrade to 1.16
If you haven't upgrade to 1.16.x yet, you should also consider the following changes:
- Different ports required—workers now download jobs from the job dealer service via port 8443. Previously they accessed the message queue (an instance of RabbitMQ) in the control pool directly via port 5671. Also, the web application communicates with the new search component via TCP on port 8983. You need to review your firewall and network configurations and ensure that these communication paths are available. For the full architecture diagram, see Network connections.
- New format for the cluster configuration file—your cluster configuration file is updated automatically to the new format during the upgrade process.
If your system uses an SSL certificate that wasn't generated by LGTM, you should back up the certificate and key files before you upgrade. The upgrade process from 1.15 to 1.16 will overwrite your certificate with an autogenerated certificate.
After you upgrade to 1.16
After upgrading to 1.16, you should plan to:
- Add your SSL certificate to the cluster configuration—update the cluster configuration file to specify the location of the SSL certificate files to use. This will ensure that the correct SSL certificate is automatically used and maintained through future upgrades. For more information, see the revised topic on installing SSL certificates.
- Make the IDE plugins available to users—users can uses these to download alerts from LGTM Enterprise and display the alongside the code in their IDE. You can download the installers from the customer wiki and make them available to your users. For more information, see Making IDE plugins available to users.
LGTM Enterprise will be unavailable during the upgrade. However, you don't need to take the system down yourself, the upgrade script does this for you. If LGTM's
manifest.xml file was encrypted with a custom password when the system was installed, you need to know the password to upgrade the system (if you've lost the password, see Changing or resetting a manifest password).
Open a command console for the coordinator server.
The host name of the coordinator server is specified in the
<LGTM releases directory>/state/lgtm-cluster-config.ymlfile—where <LGTM releases directory> is the directory into which the installation package for the current release was unpacked (for example,
Display the version of the currently running LGTM system by entering:
sudo lgtm-cli version
Make a note of the version number. You will use this later to confirm that the system was upgraded.
lgtm-<version>.tar.gzfile for the new release to the coordinator server.
- Put this file in your LGTM releases directory alongside the
Unpack the file:
tar -xvf lgtm-<version>.tar.gz
This creates an
Change to the
upgrade.shscript in this directory:
- The script expects to find a cluster configuration file called
statedirectory located in the same directory as the
/home/adminuser/lgtm-releases/lgtm-n.nn/state/lgtm-cluster-config.yml. If the cluster configuration file is located elsewhere, give the path to this file as an argument to the script.
- The script must be run using
sudo, or as the root user.
- The script expects to find a cluster configuration file called
Enter the password that was used to encrypt the manifest file when LGTM Enterprise was originally installed.
Follow the remaining on-screen prompts.
When the upgrade is complete, check the version number again by entering:
sudo lgtm-cli version
Check the status of your license by entering:
sudo lgtm-cli license
If there are less than three months left before expiry, we recommend that you make a reminder to upload a new license before this date to avoid disruption to users. If the license is due to expire soon and you haven't received a new license from your LGTM support team, contact them now. New licenses can be uploaded via the administration pages, or using the
licenseCLI action, at any time.
- Check the relevant After you upgrade to... section above for any additional steps you need to take to finish configuring the new version.
If you use the directory structure suggested here, after upgrading you'll have the following directories:
<lgtm-old-version> directory can safely be deleted. It's not used after you've upgraded. For example, you might delete the
lgtm-1.17.2 directory after upgrading to LGTM Enterprise 1.18.0.