Upgrade sonarqube 8.4.2 to sonarqube 8.8

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    Server1: SonarQube 8.4.2-community
    Server2: SonarQube 8.4.2-developer

  • what are you trying to achieve
    Upgrade from 8.4.2 community and developer edition to 8.8

  • what have you tried so far to achieve this
    We are using the docker containers with ecs. I tried to update the image tag version with newest one.
    I was having the following errors

  • Upgrade to 8.8 was failed (some properties has been changed i.e. allow_mmapfs → allow_mmap, was still failing, might be there are more),

  • Upgrade to 8.5 failed again with Can not connect to database.

  • Reverted back to the 8.4.2 was successful

Could you please help me with clear and better instructions to upgrade to 8.8 for community and developer both editions?

Do I need to update/add/remove environment variables?
Do I need to change something in the database i.e. running any alter commands for postgres?

Hi @Karandeep_Singh ,

the only property changes that i am aware of tackle the search configuration. Usually there is no need to touch this configuration of community or developer edition. can you share your configuration?

The general approach looks good to me. you should make sure that you have a db backup before starting thou and depending on you usage of 3rd party plugins you have to make sure that they are compatible with the target version.
one last note on persistency; with SQ 8.5 we changed the way how we embed our language analyzers, so make sure that your plugins directory does not contain any old plugins.

I tried to do it on my local machine with very simple steps
version: “3”

services:
  sonarqube:
    image: sonarqube:8.4-community
    depends_on:
      - db
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://db:5432/sonar
      SONAR_JDBC_USERNAME: sonar
      SONAR_JDBC_PASSWORD: sonar
    volumes:
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_logs:/opt/sonarqube/logs
    ports:
      - "9000:9000"
  db:
    image: postgres:12
    environment:
      POSTGRES_USER: sonar
      POSTGRES_PASSWORD: sonar
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_logs:
  postgresql:
  postgresql_data:

That’s the official docker-compose file.
Steps to reproduce

  1. docker-compose -f docker-compose-file.yaml up -d

  2. Wait until everything is done, Once you login with admin:admin in the browser

  3. Now update the sonarqube version to 8.8

    sonarqube:
    image: sonarqube:8.8-community

  4. docker rm -f

  5. docker-compose up -d sonarqube

now if you check the logs

2021.04.22 17:30:02 INFO  web[][o.s.s.u.SystemPasscodeImpl] System authentication by passcode is disabled
2021.04.22 17:30:03 WARN  web[][o.s.s.p.DatabaseServerCompatibility] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2021.04.22 17:30:03 WARN  app[][startup] ################################################################################
2021.04.22 17:30:03 WARN  app[][startup] The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
2021.04.22 17:30:03 WARN  app[][startup] ################################################################################
2021.04.22 17:30:03 ERROR app[][startup] Startup failed: Plugins can't be loaded. See web logs for more information

logs.txt (8.2 KB)

:point_up:

the named volume sonarqube_extensions does still contain old plugins. if you were not using any special 3rd party plugins, you can remove this volume as it will be recreated when you start your stack with the compose file you posted.