Projects not showing after upgrading from 8.9.10 to 9.9.3 in Sonarqube

I am trying to upgrade my sonarqube from version 8.9.10 to a LTS version 9.9.3. Iam performing this in my kubernetes cluster .Iam also using postgresql as the db (version 10.5 for older sonarqube and version 15 for 9.9 version sonarqube). So for testing the upgrading setup we are doing the steps in a sandbox cluster where i setup the older version solar and setup 2 projects in it.

The steps i tried for upgrade :

  1. Backed up my postgresql database from my sonarqube db and /data and /extensions folder in my sonarqube app
  2. Deleted the es folder
    3)Scaled down my statefulset of both database and sonarqube.
  3. Upgraded the version of postgres and restored the data back into the db.
  4. Applied the newer version of sonarqube and scaled up the sonarqube statefulset also .

and after doing this when i port-forwarded the sonarqube iam not abole to see the previous sample two projects i created in the 8.9 version are not seen in the 9.9 version . When i open the 9.9 version it ask’s me to setup the projects.

How can i get my old projects to be there even after upgrade , in my production instances there are over 51 projects .


This above image is how the older version looked like with 2 projects.

This second image is the newer version where the older projects are not visible . I created a new project there

Hey there.

  • Can you share how you’ve configured your values.yaml file?
  • Did your SonarQube instance otherwise behave like a brand new instance – for example making you set a new password for the default admin account?

yes the upgraded sonarqube asked to reset the admin password.

Iam not using a helm chart but yaml files.

This is the yaml file for the latest 9.9 version:
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: common
name: common-sonarqube-app
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: common
pod: common-sonarqube-app
serviceName: common-sonarqube-app
template:
metadata:
labels:
app: common
pod: common-sonarqube-app
spec:
securityContext:
runAsUser: 999
runAsGroup: 999
fsGroup: 999
initContainers:
- name: sysctl
image: busybox:1.30.1
imagePullPolicy: IfNotPresent
command: [‘sysctl’, ‘-w’, ‘vm.max_map_count=272144’]
securityContext:
privileged: true
containers:
- image: sonarqube:9.9.3-community
imagePullPolicy: IfNotPresent
name: common-sonarqube-app
ports:
- containerPort: 9000
resources:
limits:
cpu: 1
requests:
cpu: 0.5
memory: 1Gi
env:
- name: SONAR_WEB_CONTEXT
value: /sonarqube
- name: SONARQUBE_JDBC_URL
value: jdbc:postgresql://common-sonarqube-db-0.common-sonarqube-db:5432/sonarqube
- name: SONARQUBE_JDBC_USERNAME
valueFrom:
secretKeyRef:
key: DB_USERNAME
name: common-sonarqube-db
- name: SONARQUBE_JDBC_PASSWORD
valueFrom:
secretKeyRef:
key: DB_PASSWORD
name: common-sonarqube-db
livenessProbe:
httpGet:
path: /sonarqube/api/system/status
port: 9000
initialDelaySeconds: 60
periodSeconds: 30
readinessProbe:
httpGet:
path: /sonarqube/api/system/status
port: 9000
initialDelaySeconds: 60
periodSeconds: 30
failureThreshold: 6
volumeMounts:
- mountPath: /opt/sonarqube/data
name: common-sonarqube-app-storage
subPath: data
- mountPath: /opt/sonarqube/extensions
name: common-sonarqube-app-storage
subPath: extensions
volumeClaimTemplates:

  • metadata:
    labels:
    app: common
    name: common-sonarqube-app-storage
    spec:
    accessModes:
    • ReadWriteOnce
      resources:
      requests:
      storage: 2Gi
      storageClassName: standard

and this is the yaml file for 8.9:
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app: common
name: common-sonarqube-app
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: common
pod: common-sonarqube-app
serviceName: common-sonarqube-app
template:
metadata:
labels:
app: common
pod: common-sonarqube-app
spec:
securityContext:
runAsUser: 999
runAsGroup: 999
fsGroup: 999
initContainers:
- name: sysctl
image: busybox:1.30.1
imagePullPolicy: IfNotPresent
command: [‘sysctl’, ‘-w’, ‘vm.max_map_count=272144’]
securityContext:
privileged: true
containers:
- image: sonarqube:8.9.10-community
imagePullPolicy: IfNotPresent
name: common-sonarqube-app
ports:
- containerPort: 9000
command:
- ./bin/run.sh
- -Dsonar.web.context=/sonarqube
resources:
requests:
cpu: 0.5
memory: 1Gi
env:
- name: SONARQUBE_JDBC_URL
value: jdbc:postgresql://common-sonarqube-db-0.common-sonarqube-db:5432/sonarqube
- name: SONARQUBE_JDBC_USERNAME
value: sonarqube # Updated JDBC username
- name: SONARQUBE_JDBC_PASSWORD
value: 7emPw6mgdt1sU6Uh
volumeMounts:
- mountPath: /opt/sonarqube/data
name: common-sonarqube-app-storage
subPath: data
- mountPath: /opt/sonarqube/extensions
name: common-sonarqube-app-storage
subPath: extensions
volumeClaimTemplates:

  • metadata:
    labels:
    app: common
    name: common-sonarqube-app-storage
    spec:
    accessModes:
    • ReadWriteOnce
      resources:
      requests:
      storage: 2Gi
      storageClassName: standard

when i upgraded from 7.9 to 8.9 it worked well the projects where there but this 8.9 to 9.9 is where the issue starts.
Colin thanks for getting back

Here’s the problem.

From the upgrade notes:

  • The deprecated SONARQUBE_JDBC_USERNAME, SONARQUBE_JDBC_PASSWORD, and SONARQUBE_JDBC_URL variables have been removed. See Environment variables for up-to-date configuration variables.

So you have probably started up against the internal embedded database with no data. Switch out the configuration to that mentioned in the docs, and you should be able to finish a real upgrade.

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