Upgrade from 7.1 to 7.9.3-community

Hello,

I’m trying to upgrade from 7.1 to 7.9.3-community

On 7.1, I installed sonarqube as a service on Ubuntu 16.04 with Postgres9.6. This is running fine. I want to run it as docker for easy deployments. So I have copied entire sonarqube directory from PROD to test VM. Took a backup of database and restored. Below is my compose file.

version: "3"
services:
  sonarqube:
    image: sonarqube:7.9.3-community
    restart: unless-stopped
    environment:
      - SONARQUBE_JDBC_USERNAME=postgres
      - SONARQUBE_JDBC_PASSWORD=postgres
      - SONARQUBE_JDBC_URL=jdbc:postgresql://192.168.1.35:5432/sonarqube
    ports:
      - "9000:9000"
    volumes:
      - /home/praveen/sonarqube/sonarqube-7.1/data:/opt/sonarqube/data
      - /home/praveen/sonarqube/sonarqube-7.1/extensions:/opt/sonarqube/extensions
      - /home/praveen/sonarqube/sonarqube-7.1/lib/bundled-plugins:/opt/sonarqube/lib/bundled-plugins

I’m getting below error

docker-compose -f sonar.yml up
sonarqube_1  | tail: cannot open './logs/es.log' for reading: No such file or directory
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory /opt/sonarqube/temp
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.s.a.es.EsSettings] Elasticsearch listening on /127.0.0.1:9001
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.s.a.ProcessLauncherImpl] Launch process[[key='es', ipcIndex=1, logFilenamePrefix=es]] from [/opt/sonarqube/elasticsearch]: /opt/sonarqube/elasticsearch/bin/elasticsearch
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.s.a.SchedulerImpl] Waiting for Elasticsearch to be up and running
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.e.p.PluginsService] no modules loaded
sonarqube_1  | 2020.06.15 16:17:59 INFO  app[][o.e.p.PluginsService] loaded plugin [org.elasticsearch.transport.Netty4Plugin]
sonarqube_1  | OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
sonarqube_1  | 2020.06.15 16:18:02 WARN  app[][o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 1
sonarqube_1  | 2020.06.15 16:18:02 INFO  app[][o.s.a.SchedulerImpl] Process[es] is stopped
sonarqube_1  | 2020.06.15 16:18:02 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
sonarqube_sonarqube_1 exited with code 0

Can someone please help ?

So I have added few more volumes and had to give chmod 777 to sonarqube directory.

version: "3"
services:
  sonarqube:
    image: sonarqube:7.9.3-community
    restart: unless-stopped
    environment:
      SONAR_JDBC_URL: jdbc:postgresql://192.168.1.35:5432/sonar
      SONAR_JDBC_USERNAME: postgres
      SONAR_JDBC_PASSWORD: postgres
    ports:
      - "9000:9000"
    volumes:
      - /home/praveen/sonarqube/sonarqube-7.1/data:/opt/sonarqube/data
      - /home/praveen/sonarqube/sonarqube-7.1/extensions:/opt/sonarqube/extensions
      - /home/praveen/sonarqube/sonarqube-7.1/lib/bundled-plugins:/opt/sonarqube/lib/bundled-plugins
      - /home/praveen/sonarqube/sonarqube-7.1/logs:/opt/sonarqube/logs
      - /home/praveen/sonarqube/sonarqube-7.1/temp:/opt/sonarqube/temp

Is this the right way ?

Hi,

I don’t know anything about Docker, but I do know that you don’t need to move your 7.1 to Docker to make this change. Just spin up your 7.9.3 image and point it at the same database. You should be good.

 
HTH,
Ann

Hello,

I have to persist the volumes as it contains logs and plugins. This will come handy for me for upgrades/deployments. But I’m able to deploy. The only concern is to give 777 permissions to sonar directory. Else, I get permissions issue because Sonarqube runs under sonar user in container and not as root.