Upgrading Sonarqube in kubernetes , currently on image 7.8-developer

Must-share information (formatted with Markdown):

  • 7.8-developer
  • upgrade to a newer version
  • nothing yet but planning an upgrade.

Hi there,

I’ve been handed a sonarqube deployment to upgrade. I’m not familiar with the application and havent upgraded it before. We have it running as a deployment in a K8s cluster at present using a postgres rds (engine 9.6.20) and the image is 7.8-developer. I see that there is a LTS version at 7.9 but in docker hub that is marked as -community

Is it possible to upgrade from 7.8 developer to 7.9 community ? eventually I want to get into the 8.x.x versions but I believe I first need to go via 7.9

Hi, in term of upgrade path you indeed need to first upgrade to 7.9.

With every SonarQube upgrade, SonarQube will patch the database to migrate to the current version. This does not depend on the SonarQube edition (community, developer, etc), and the database schema is upgraded the same way, regardless of the edition.

So in term of database management, you are safe to upgrade to 7.9-community, to then upgrade to 8.9-developer.

Don’t forget to backup your database (as a safety net) before proceeding to the upgrade :+1:

About K8s & docker in general, you want to pay attention to your volume management, make sure you don’t loose any custom plugins you may have. And you will need to not keep the /data/es6/ folder, as we upgraded to elasticsearch 7. The elasticsearch indexes will be recreated during SQ startup, after the database migration completed.

@pierreguillot thank you so much, that is very helpful

@pierreguillot Hi again Pierre,

Just wondering about one thing when you mention " you will need to not keep the /data/es6/ "

Is this something I will need to manually delete? It looks like we have a deployment and its got two persistent volumes , one for plugins and one for a certificate. I was curious where the /data/es6 is mounted and if I need to change any config to have it deleted or will that just naturally happen when I upgrade?

Mounting the /data/es6 folder is not mandatory. It’s documented here that you can mount this folder to a volume for persistence. If you don’t, SonarQube will “simply” rebuild it’s elasticsearch index during startup (if you recreate the container). The consequence for you is going to be a longer startup time, from less than a minute for a small database, to several hours for a huge one.

If it’s not currently in a persistent volume, you don’t need to do anything. It will be recreated at startup.