How we can upgrade sonarqube from 6.7 to 9.9 LTS

  • What version are you upgrading from?
    Sonarqube Version 6.7 (build 33306)

  • System information (Operating system, Java version, Database provider/version)

  1. Operating system :- Centos 7

  2. Java version :-
    java -version
    openjdk version “1.8.0_382”
    OpenJDK Runtime Environment (build 1.8.0_382-b05)
    OpenJDK 64-Bit Server VM (build 25.382-b05, mixed mode)

  3. Database

PostgreSQL 9.6

  • What’s the issue you’re facing?

In the documents it is mentioned as for the upgrade to the latest LTS version, we need to upgrade step by step to all previous LTS version. In our case we have old sonarqube version 6.7.0.33306 and we need to upgrade to the latest one. So I am looking for the best option to follow and need to complete the upgrade.

But when I check the documents, I don’t see much details about the old versions and the zip file to download. So can someone guide me to get all the details and the best steps to follow the upgrade. I assume, I have to follow the upgrade procedure as 6.7> 7.9 LTS > 8.9 LTS > 9.9 LTS.

Also would like to know what will happen if we directly upgrade to the latest 9.9 LTS from 6.7 ?

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube: 6.7.3
    Scanner: sonar-scanner-cli-3.0.3.778
  • how is SonarQube deployed: zip, Docker, Helm
    Installer
  • what are you trying to achieve: Upgrade from v6.7.3 to v9.9 LTS
  • what have you tried so far to achieve this: We have checked that we need to use mysql-migrator utlity to migrate data present in MySQL 5.7 to PostgreSQL DB v13

Hi

Please can you help us define the migration path and steps required to upgrade from:
a. Current Status: SonarQube Community Edition v6.7.3 + DB(MySQL 5.7)
b. Target: SonarQube Community Edition v9.9 LTS + DB(PostgreSQL v13)

We also need to migrate data from current DB MySQL 5.7 to PostgreSQL v13.

We could not find any documentation for v6.7, hence request you to share the link for the same.

Please let me know if any more information is required at my end.

Thanks
Akhil Gupta

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hi all,

Welcome to the community!

I’ve combined your two threads because they came in at approximately the same time and they’re essentially the same.

To get from 6.7.* to 9.9.4, your upgrade path is:

6.9.* → 7.9.6 → 8.9.10 → 9.9.4 → 10.4 (last step optional)

You can find those intermediate versions on the historical downloads page.

You may find these resources helpful:

Note that along the way, you’ll need to upgrade your Java version too. You’ll need Java 11 to start up SonarQube 8.9. For 9.9, you’ll need Java 17. As you’ve noted, the docs aren’t available for 7.9. I believe you’ll be okay with either Java 8 or 11 (but that was a looong time ago).

It’s simply not possible. SonarQube 9.9 doesn’t understand all the DB schema changes that need to be made to a 6.7 DB.

As noted in the MySQL migrator readme, the migration is required to move to SonarQube 7.9. So I suggest doing that first, before you start your SonarQube upgrade. Also based on that readme, it looks like you’ll have to start with an older version of Postgres, and upgrade to Postgres 13 along the way.

 
HTH,
Ann

Hi Ann

Thanks for sharing the migration path information.

On Analysis we see the below path with details as:
SonarQube 6.9.* → 7.9.6 → 8.9.10 → 9.9.4 → 10.4 (last step optional)
PostgreSQL 10 10 10->13 13 13->15
Java 8 8 8->11 11->17 17

  • → Arrow indicates the version upgrade.

Please find below queries as:
a. Please help share 6.9.* installer path as it is not available on Sonar website. And is this mandatory or we can upgrade from 6.7.3 to 7.9.6 directly.
b. Also please help to share 7.9.6 upgrade guide to validate the pre-requisites, plugin compatibly matrix and other details required for upgrade from v6.7.3. And If documentation not available then please let me know the steps required at my end to move forward with upgrade to v7.9.6.

Thanks
Akhil

Hi Akhil

Sorry, I mistyped; there is no 6.9. You can upgrade from 6.7.3 straight to 7.9.6.

Sorry, but we didn’t write one for 7.9.6.

I believe 7.9.6 will need Java 8.

There’s no point because there’s no need to install plugins. You’re going to configure 7.9.6, start up the server, perform the DB upgrade, and then move on to the next version.

 
HTH,
Ann

Hi Ann, we have successfully completed the upgrade to 9.9. But during the build we are getting the below error . Could you please provide some insights on how we can resolve this issue. The java version in the sonar server is Java 17 and our application server is using Java 8

Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922:sonar (default-cli) on project **********: Execution default-cli of goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922:sonar failed: An API incompatibility was encountered while executing org.sonarsource.scanner.maven:sonar-maven-plugin:3.11.0.3922:sonar: java.lang.UnsupportedClassVersionError: org/sonar/batch/bootstrapper/EnvironmentInformation has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

Hi @km.jithesh,

This guide should help:

If it doesn’t, please create a new thread.

 
Ann