010-68421378
sales@cogitosoft.com
Your location:Home>News Center >Industry News

SonarQube:Upgrade Guide

发布时间:2021/11/16 浏览量:499
This is a generic guide for upgrading across versions of SonarQube. Carefully read the Release Upgrade Notes of your target version and of any intermediate version(s).

 

SonarQube:Upgrade Guide

This is a generic guide for upgrading across versions of SonarQube. Carefully read the Release Upgrade Notes of your target version and of any intermediate version(s).

Before upgrading, we recommend practicing your upgrade on a staging environment as similar to your production environment as possible.

Before upgrading, back up your SonarQube database. Upgrade problems are rare, but you'll want the backup if anything does happen.

Before You Upgrade

This page contains some concepts and recommendations that you should familiarize yourself with before upgrading.

SonarQube version number format

Version numbers have up to three digits with each digit representing part of the release cycle:

 

Major version number
The major version number represents a series of releases with high-level objectives for the release cycle. It's incremented with the release following an LTS version (for example, the release following 7.9 LTS was 8.0).

Minor version number
The minor version number corresponds to incremental functional changes within a major release cycle. At the time of an LTS release, the release cycle is closed and the minor version number is frozen.

Patch release number
Only on LTS versions, the patch release number represents patches to an LTS that fixed blocker or critical problems. The patch release number isn't considered in your upgrade migration path, and your migration path is the same no matter which patch number you are on.

Migration path

Upgrading across multiple non-LTS versions is handled automatically. However, if there are one or multiple LTS versions in your migration path, you must first migrate to each intermediate LTS and then to your target version, as shown in Example 3 below.

If you're migrating from an earlier patch version of an LTS, you can upgrade directly to the next LTS. You don't need to install any intermediate patch versions.

Migration Path Examples:

Example 1 – From 8.1 > 9.0, the migration path is 8.1 > 8.9.1 LTS > 9.0
Example 2 – From 8.2 > 8.9 LTS, the migration path is 8.2 > the latest 8.9 LTS patch.
Example 3 – From 6.7.7 LTS > 8.9 LTS, the migration path is 6.7.7 LTS > 7.9.6 LTS > the latest 8.9 LTS patch.

Release Upgrade Notes

Usually SonarQube releases come with some specific recommendations for upgrading from the previous version. You should read the Release Upgrade Notes for each version between your current version and the target version.

Practice your upgrade

We recommend practicing your upgrade to:

To practice your upgrade, create a staging environment using a recent backup of your production database. You want your staging environment to be as similar to your production instance as possible because the resources and time needed to upgrade depends on what's stored in your database. Use this staging environment to test the upgrade, observing how long it takes to back up and restore systems and complete the process.

 

Database disk usage recommendations

During your upgrade, tables may be duplicated to speed up the migration process. This could cause your database disk usage to temporarily increase to as much as double the normal usage. Because of this, we recommend that your database disk usage is below 50% before starting a migration.

Upgrading from the ZIP file

Upgrading from the Docker image

If you're upgrading with an Oracle database or you're using plugins, you can reuse your extensions volume from the previous version to avoid moving plugins or drivers. Use the Plugin Version Matrix to ensure that your plugins are compatible with your version. Analysis of all languages provided by your edition is available by default without plugins.

To upgrade SonarQube using the Docker image:

$ docker stop <container_id>

$ docker rm <container_id>

$> docker run -d --name sonarqube \

    -p 9000:9000 \

    -e SONAR_JDBC_URL=... \

    -e SONAR_JDBC_USERNAME=... \

    -e SONAR_JDBC_PASSWORD=... \

    -v sonarqube_data:/opt/sonarqube/data \

    -v sonarqube_extensions:/opt/sonarqube/extensions \

    -v sonarqube_logs:/opt/sonarqube/logs \

    <image_name>

From 8.9.x LTS to another 8.9.x LTS

No specific Docker operations are needed, just use the new tag.

Upgrading from the Helm Chart

If you're upgrading with an Oracle database or you're using plugins, you can reuse your extensions PVC from the previous version to avoid moving plugins or drivers. Use the Plugin Version Matrix to ensure that your plugins are compatible with your version. Analysis of all languages provided by your edition is available by default without plugins.

To upgrade SonarQube using our official Helm Chart:

helm upgrade --install -f values.yaml -n <your namespace> <your release name> <path to sonarqube helm chart>

Rollback

If you need to revert to the previous version of SonarQube, the high-level rollback procedure for all deployments is as follows:

Changing your edition

If you're moving to a different edition within the same version of SonarQube (for example, from Community Edition to a commercial edition), the steps are exactly the same as above without needing to navigate to http://yourSonarQubeServerURL/setup or reanalyze your projects.

Migrating from a ZIP file instance to a Docker instance

To migrate from the ZIP file to Docker:

Additional steps and information

Oracle clean-up

Starting with version 6.6, there's an additional step you may want to perform if you're using Oracle. On Oracle, the database columns to be dropped are now marked as UNUSED and are not physically dropped anymore. To reclaim disk space, Oracle administrators must drop these unused columns manually. The SQL request is ALTER TABLE foo DROP UNUSED COLUMNS. The relevant tables are listed in the system table all_unused_col_tabs.

Additional database maintenance

We recommend refreshing your database's statistics and rebuilding your database's indices once you've finished the technical upgrade, but before you reanalyze your projects.

For PostgreSQL, that means executing VACUUM FULL. According to the PostgreSQL documentation:

In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done.

Scanner update

When upgrading SonarQube, you should also make sure you’re using the latest versions of the SonarQube scanners to take advantage of features and fixes on the scanner side. Please check the documentation pages of the scanners you use for the most recent version compatible with SonarQube and your build tools.

SonarQube as a Linux or Windows service

If you use an external configuration, such as a script or Windows Service to control your server, you'll need to update it to point to $NEW_SONAR_HOME.

sc config SonarQube binPath= "\"$NEW_SONAR_HOME\bin\windows-x86-64\wrapper.exe\" -s \"$NEW_SONAR_HOME\conf\wrapper.conf\""

Rebuilding indexes

If your upgrade requires the rebuild of Elasticsearch indexes, your projects and applications will become available as they are reindexed. Portfolios won't be available until all projects are indexed.

 

下一篇:5.22 Wolfram 中国第二届在线技术大会详细内容
上一篇:Wolfram|COVID-19-策略模拟器-您能找到理想的策略吗?

© Copyright 2000-2023  COGITO SOFTWARE CO.,LTD. All rights reserved