How to upgrade sonarqube developer edition 9.6.1 to latest 9.9 . using docker compose

Team,
i am running my dev edition of sonarqube 9.6.1 using docker-compose.yml.
Notification says that it has reached end of life. what is the safe procedure ti upgrade server to 9.9 without loosing existing analysis

Hey there.

It should just be a matter of changing the image tag to 9.9-developer and recycling the container (with all your existing config, like database connection, staying put).

Make sure you read the upgrade guide.

1 Like

hi there,
our sonarqube is also using docker-compose.yml. did the recommendation below work for you? we tried it and it can’t connect to our SQL server and instead used the embedded H2 database and it also lost the active directory configuration.
if you don’t mind, kindly let us know how you went about to upgrade your version.
regards,
d

That’s not true. As long as the database persists, it should work.

It’s also important to pay attention to the upgrade notes.

Docker images updated

  • Recommended Docker Engine version is 20.10 and later.
  • If you use self-signed certificates, you may need to adjust your Docker configuration: the path of the Java installation has changed to /opt/java/openjdk/. See Install the server for more information.
  • 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.
  • The lts tag on Docker images is replaced with the new LTS release. If you want to avoid any automatic major upgrades, we recommend using the corresponding 9.9-<edition> tag instead of lts-<edition>.

We are using Ubuntu 18.04.6 LTS (GNU/Linux 5.4.0-1105-azure x86_64) and
Docker version: 20.10.11

We did follow the upgrade guide and changed the configuration variables to the recommended ones. It looks like SonarQube cannot talk to the SQL database anymore. Here are the errors that we are seeing.

sonarqube_1 | WARNING: A terminally deprecated method in java.lang.System has been called
sonarqube_1 | WARNING: System::setSecurityManager has been called by org.sonar.process.PluginSecurityManager (file:/opt/sonarqube/lib/sonar-application-9.9.0.65466.jar)
sonarqube_1 | WARNING: Please consider reporting this to the maintainers of org.sonar.process.PluginSecurityManager
sonarqube_1 | WARNING: System::setSecurityManager will be removed in a future release
sonarqube_1 | 2023.04.14 15:03:44 INFO web[o.s.p.ProcessEntryPoint] Starting Web Server
sonarqube_1 | 2023.04.14 15:03:45 INFO web[o.s.s.p.LogServerVersion] SonarQube Server / 9.9.0.65466 / ce743843018827cb30c05735e7971523de34bb48
sonarqube_1 | 2023.04.14 15:03:45 INFO web[o.sonar.db.Database] Create JDBC data source for jdbc:sqlserver://database_1:1433;databaseName=sonar
sonarqube_1 | 2023.04.14 15:03:45 INFO web[c.z.h.HikariDataSource] HikariPool-1 - Starting…
sonarqube_1 | 2023.04.14 15:03:47 ERROR web[c.z.h.p.HikariPool] HikariPool-1 - Exception during pool initialization.
sonarqube_1 | com.microsoft.sqlserver.jdbc.SQLServerException: The driver could not establish a secure connection to SQL Server by using Secure Sockets Layer (SSL) encryption. Error: “PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target”. ClientConnectionId:ec7769de-3862-4826-994a-977a84618ef0

To stop SonarQube to use the embedded H2 database, we commented out couple of lines in the docker-compose.yml file. Here it is…

version: '2'

services:
  sonarqube:
          #    depends_on:
          #      - database_1
    image: sonarqube:9.9-developer
    command: "-Dsonar.search.javaAdditionalOpts=-Dnode.store.allow_mmap=false"
    ports:
      - "9000:9000"
    volumes:
      - sonarqube-conf:/opt/sonarqube/conf
      - sonarqube-data:/opt/sonarqube/data
      - sonarqube-extensions:/opt/sonarqube/extensions
      - sonarqube-bundled-plugins:/opt/sonarqube/lib/bundled-plugins
    environment:
      - SONAR_JDBC_URL=jdbc:sqlserver://database_1:1433;databaseName=sonar
      - SONAR_JDBC_USERNAME=sa
      - SONAR_JDBC_PASSWORD=password!
      - SONAR_ES_BOOTSTRAP_CHECKS_DISABLE=true

  database_1:
    image: mcr.microsoft.com/mssql/server:2019-latest
    container_name: mssql-server
    ports:
      - "5550:1433"
    volumes:
      - docker:/var/opt/mssql
    environment:
      ACCEPT_EULA: 'Y'
      MSSQL_SA_PASSWORD: password!
      MSSQL_PID: Express
      MSSQL_COLLATION: SQL_Latin1_General_CP1_CS_AS

volumes:
  sonarqube-conf:
  sonarqube-data:
  sonarqube-extensions:
  sonarqube-bundled-plugins:
  docker:

Thank you,
D

@dariodecastro Take a look at these upgrade notes:

Release 9.6 upgrade notes

Microsoft SQL Server changes in configuration and Integrated Authentication

  • If your Microsoft SQL Server doesn’t support encryption, you will need to add encrypt=false to the JDBC URL connection string. (SONAR-16249).
  • If your Microsoft SQL Server requires encryption but you don’t want SonarQube to validate the certificate, you will need to add trustServerCertificate=true to the JDBC URL connection string.

hi colin,

we tried your suggestion and it worked… trustServerCertificate=true.

thanks much for your help, it is much appreciated.

cheers,
d