Restore "Projects" and "Users" from SonarQube 9.9.0 to SonarQube 9.9.1

Hi guys,

I was afraid to upgrade my 9.9.0 environment to 9.9.1 so I raised a 9.9.1 environment via Helm Chart parallel to this 9.9.0 environment, I thought about restoring my “projects” and “users” in this new environment and then remove the old environment, then ran a pg_dump of the 9.9.0 environment’s sonar_db and restored this dump to the 9.9.1 environment’s sonarDB, however to my surprise, my SonarQube POD stopped.

➜ k get pod
sonarqube-postgresql-0 1/1 Running 0 45s
sonarqube-sonarqube-0 0/1 CrashLoopBackOff 29 (92s ago) 138m

I believe that in this case, it would be interesting to know which one to perform only the restore of the “projects” and “users” table for version 9.9.1 because I think that it may have changes in DB variables and tables, however, I also do not know how to do that in Postgres, for backup I only know pg_dump and pg_dumpall, which performs the backup of the entire DB.

Has anyone gone through a similar experience to help me? (attached the log file)

k logs -f sonarqube-sonarqube-0| grep ERROR
:19 ERROR web[o.s.s.p.Platform] Background initialization failed. Stopping SonarQube
org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘jdk.internal.loader.ClassLoaders$AppClassLoader@3c5a99da-org.sonar.server.platform.serverid.ServerIdManager’: Initialization of bean failed; nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2 at at$doGetBean$0(

Hey there.

You really can’t pick and choose tables to bring with you in an upgrade. The SonarQube database schema is complex, and all the information you need to bring in an upgrade isn’t limited to those two tables.

As long as you have a full backup of your SonarQube v9.9.0 database, you’re safe in case something goes wrong.

I suggest following the Upgrading from the Helm chart instructions here, which is mostly just a case of changing the SonarQube version in your values.yml file.

Thanks for the quick response, I’ll follow your advice.

Please just answer me one last question, where can I find “values.yml”?

➜ helm repo add sonarqube Sonarsource Chart Repository
“sonarqube” has been added to your repositories
➜ helm repo update
Hang tight while we grab the latest from your chart repositories…
…Successfully got an update from the “sonarqube” chart repository
Update Complete. ⎈Happy Helming!⎈

➜ find / -iname values.yml
➜ find / -iname “values*”
➜ find / -iname sonarqube