How to Upgrade SonarQube 7.9 to 8.9 LTS

This article will explain to you how to upgrade SonarQube from version 7.9 to 8.9. I will elaborate with simple steps. This step has been implemented in my work.

upgrade sonarqube
SonarQube

Detail existing: I have a SonarQube server that has deployed to AWS EC2 instance with docker-compose setup.

Tech Task: Upgrade version of SonarQube image to new latest LTS version.

Step by step

1. Create Snapshot and AMI from the currently running instance

2. Create RDS Snapshot

3. SSH to SonarQube Instance

4. Stop docker-compose service (please go to the directory where your compose’s directory located)

cd /home/${USER}/sonarqube
docker-compose stop

5. Copy directory recursively sonarqube to sonarqubeupgrade

cd ..
cp -rf sonarqube sonarqubeupgrade

6. Back up all plugins to another directory

cd sonarqubeupgrade
mkdir backup-plugin
cp sonarqube/extensions/plugins/* backup-plugin/

7. Remove all plugins

rm extensions/plugins/*.jar

8. Edit value image: in docker-compose.yml to sonarqube:8.9-community

9. Update Env Vars Key for DB Connection

        - SONARQUBE_JDBC_URL=jdbc:postgresql://xxx.ap-southeast-1.rds.amazonaws.com/dbname
        - SONARQUBE_JDBC_USERNAME=xxx
        - SONARQUBE_JDBC_PASSWORD=xxx

10. Compose Up

docker-compose up -d

11. Doing DB Migration https://sonar.yourdomain.com/setup

12. Install the Plugin is needed

13. Testing