Upgrade from 8.7.1 community edition to 8.9 LTS community edition

Short version:

  • I am using SonarQube community edition 8.7.1 build 42226. H2 database.
  • I am trying to upgrade to 8.9.1 LTS
  • I have tried to copy the data folder from the old version but when starting sonarqube the system complains saying that i need to backup the DB and setup / browse

Long version:

I am completely new to Sonarqube and static code analysis. I have inherited a system that was used to check data quality for a Java project. The person that performed the checks used the 8.7.1 community edition with embedded H2 database.

Reading around I found that 8.7 is not supported and upgrade to LTS 8.9 version is recommended. Also I found out that 8.9 supports dependency checks of the libraries imported in the project.

So with all this in mind I have a few questions:

  • What is the best way to upgrade to 8.9 LTS version? I have exported the XML with the rules but I would like to import also the analysis information performed under 8.7.1

  • What is your advice for my setup? I see comments that the embedded H2 DB is only advisable to use it for testing purposes. I am running this in an isolated laptop running Windows 7/10 so scans are local. I am wondering if to avoid future issues in case we want to upgrade to another LTS community edition or change to a developer or enterprise edition if it is best to use postgresql, sql server (or express) or any other database? I am not planning to have a connected central sonarqube server in our network (at least in the foreseeable future).

Hey there.

Like the big warning says when using an embedded database:

The embedded database will not scale, it will not support upgrading to newer versions of SonarQube, and there is no support for migrating your data out of it into a different database engine.

It is probably in your best interest to Install a new SonarQube Server (connected to a real database engine that supports upgrading from version to version) and analyze the Java project fresh on the new server. By default, this means you won’t get historical analysis data, although it would be possible to rebuild the history of your project by analyzing specific versions and passing the sonar.projectDate analysis parameter.

Thanks for answering so fast!

Which DB engine do you recommend me? SQL Server Express? PostgreSQL? I want to avoid any future issues in case we decide to use Linux instead of Windows. Is it possible to upgrade community edition versions no matter with DB engine you use? I haven´t found in the docs how to upgrade an existing DB with any other engines when using community editions.

Also, can you expand about the sonar.projectDate thing you mention for rebuilding the history of my project? Thanks

@Colin can you expand your answer? Many thanks