Upgrading SonarQube when using Docker Compose

Currently on: SonarQube 8.0

Hi,

I have a docker-compose.yml something along the lines of the SonarSource example:

version: "2"

services:
  sonarqube:
    image: sonarqube:8.0-developer-beta
    container_name: sonarqube
    restart: always
    environment:
      - SONARQUBE_JDBC_URL=jdbc:postgresql://db:5432/sonar
      - SONARQUBE_JDBC_USERNAME=<redacted>
      - SONARQUBE_JDBC_PASSWORD=<redacted>
    volumes:
      - sonarqube_conf:/opt/sonarqube/conf
      - sonarqube_data:/opt/sonarqube/data
      - sonarqube_extensions:/opt/sonarqube/extensions
      - sonarqube_bundled-plugins:/opt/sonarqube/lib/bundled-plugins

  db:
    image: postgres
    container_name: postgres
    restart: always
    environment:
      - POSTGRES_USER=<redacted>
      - POSTGRES_PASSWORD=<redacted>
    volumes:
      - postgresql:/var/lib/postgresql
      - postgresql_data:/var/lib/postgresql/data

volumes:
  sonarqube_conf:
  sonarqube_data:
  sonarqube_extensions:
  sonarqube_bundled-plugins:
  postgresql:
  postgresql_data:

I’m looking to upgrade to 8.1, but I’m a bit confused what the “best” way of doing this is?

Looking at https://hub.docker.com/_/sonarqube/ “Upgrade SonarQube” , it says I should create a new SONARQUBE_HOME_NEW folder, however I am using docker volumes so am unsure how to proceed here.

When I update the docker-compose.yml file to image: sonarqube:8.1-developer-beta, I get the following error message in the logs:

################################################################################
sonarqube      |       The database must be manually upgraded. Please backup the database and browse /setup. For more information: https://docs.sonarqube.org/latest/setup/upgrading
################################################################################

How should I proceed?

Thank you in advance

Oh, I’m a muppet.

The error message is literally saying navigate to SonarQubeURL/setup. I thought it was saying to go to the Setup instructions in the upgrade manual… :man_facepalming:

My bad!

1 Like