Sonarqube upgrade from 7.9.3-community to 9.X


We have sonarqube version 7.9.3-community docker image deployed in kubernetes using helm chart oteemocharts/sonarqube (version: 9.9.0).

We tried to upgrade the docker image from 7.9.3-community to 8.2-community but when the new pod is deployed all the projects and user accounts are wiped out. And when we downgrade to 7.9.3-community we are seeing the user accounts again.

Can someone please tell us how to upgrade to version > 9.X by keeping all the existing data like projects, tokens and user accounts?

  • Thank you

Hi @Rakesh_dev and welcome to the community :wave:

all data that is used in SonarQube is hold in the database connected. When you are upgrading your installation and connect it to the same database, it will detect that there is a older data structure present and will wait for you to manually trigger a migration (migration here to restructure the old data in the database to the current required structure).
so to answer your question i would like you to check the database connection did not change and check our what you should take into consideration while upgrading here (always backup your data) and our actual upgrade guide here.

we also have a official helm chart that is provided by sonarsource btw :wink:

Hi @Tobias_Trabelsi,

Thank you you for your reply.

  • I’ve read the documentation and it seems like we need to upgrade from 7.9.3-community to an LTS version of 7.X sonarqube before upgrading to version 8.X…can you please tell me what’s the correct tag to upgrade to? I can’t find a 7.9.3-lts tag in the dockerhub image repository.

  • After creating a new 8.2-community pod I tried to go to the /setup endpoint and it said Database is up-to-date

  • I can also confirm that the database connection did not change because the only change in the helm release the image tag and everything else is the same so we know that the newer version of sonarqube pod is using the same database as the older version of sonarqube pod.

  • we will try to use the above helm chart once we finish the sonarqube upgrade.

  • Thank you

luckily 7.9 is the previous LTS that has been superseded by 8.9 LTS, so you need to jump like this:

7.9 → 8.9 → 9.2 (last step is optional)

What kind of database are you using? please note that the embedded h2 database can not handle a upgrade and is only there for evaluation purposes.

We noticed that when we upgraded to oteemocharts/sonarqube (version: 9.9.0), variables were renamed from SONARQUBE_JDBC_PASSWORD to SONAR_JDBC_PASSWORD which switched us to embedded DB. After adding the correct vars we were able to upgrade sonarqube.

I have one more question, we now have data in 2 places RDS postgresql (version 11.12) and also in local H2 database, how do we add data from embedded H2 database to already existing data in RDS postgresql?

FYI: RDS holds all the data for more than a year and local H2 database holds the data from the last 2-3 weeks

  • Thank you

This is not possible. The h2 database is ment for evaluation purposes only.

ok, thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.