Updating ec2 running v7.3 to docker running v8.8

I am trying to upgrade our SonarQube environment from AWS ec2 running SonarQube v7.3 to Docker running SonarQube v8.8.

I have been trying to update SonarQube to v7.9, then update SonarQube to v8.8 using the following high level instructions:

  1. Setup Docker running 7.4 NOT connected to 7.3 RDS

  2. Copy non-default plugins to /opt/sonarqube/extensions/plugins

  3. Run Docker running 7.4 CONNECTED to 7.3 RDS

  4. Update RDS from 7.3 to 7.4 from webapge x.x.x.x:9000/setup

  5. Setup Docker running 7.9 NOT connected to 7.4 RDS (start sonarqube 7.9)

  6. Copy non-default plugins to /opt/sonarqube/extensions/plugins

  7. Run Docker running 7.9 CONNECTED to 7.4 RDS

  8. Update RDS from 7.4 to 7.9 from webapge x.x.x.x:9000/setup

  9. Setup Docker running 8.8 NOT connected to 7.9 RDS

  10. Copy non-default plugins to /opt/sonarqube/extensions/plugins

  11. Run Docker running 8.8 CONNECTED to 7.9 RDS

  12. Update RDS from 7.9 to 8.8 from webapge x.x.x.x:9000/setup

The last error I received was after step #4:
Error: Migration not supported. Migration is not supported on embedded databases.

A few questions:
Should the Docker volumes be created on EFS/NFS or local to the Docker host?

Do I need to use different EFS/NFS volumes for each SonarQube version? The reason I ask is that I noticed in one of the documents, it mentioned, “Warning: You cannot use the same volumes on multiple instances of SonarQube.”

The Docker command that I am using to start the Docker SonarQube container is:
docker run -d --network host --rm
-p 9000:9000
–ulimit nofile=262144:262144
-e SONAR_JDBC_URL=jdbc:postgresql://x.x.x.x/sonar
-e SONAR_JDBC_USERNAME=sonar
-e SONAR_JDBC_PASSWORD=sonardbpasswordhere
-v sonarqube_conf:/opt/sonarqube/conf
-v sonarqube_extensions:/opt/sonarqube/extensions
-v sonarqube_logs:/opt/sonarqube/logs
-v sonarqube_data:/opt/sonarqube/data
sonarqube:7.9-community

Ideally I would like to deploy this with ECS, but I wanted to get through the major version upgrade first.

Hello @dprob and welcome to the community :wave:

please make sure that sonarqube is actually running against your RDS database. This error indicates that sonrqube is connected to the embedded database which, as the message states, can not be migrated.

This warning should be interpreted that you should not RUN multiple sonarqube instances with a shared volume, as this would leave the possibility open to have concurrent write operations to logs or corruptions in the elasticsearch data. if you only have 1 running SQ instance at any time you should be good to go.
if you need a dedicated EBS/EFS/NFS volume here is up to you how you want to migrate to another ec2 instance when the time comes or do backups of this filesystem etc. there is no technical requirement here.

The general approach looks good to me and should work :+1: just make sure the plugins that you are taking with you are compatible with the respected SQ version :wink:

1 Like

After step #5 Setup Docker running 7.9 NOT connected to 7.4 RDS (start sonarqube 7.9)

I see the following:
"# SonarQube is under maintenance

While waiting, you might want to investigate new plugins to extend the current functionality.

If you are an administrator and have no idea why this message is being shown, you should read the upgrade guide."

I assumed this was because I wasn’t connected to the database, so I then shutdown the docker container and ran the following to connect to the database:
docker run -d --network host --rm
-p 9000:9000
–ulimit nofile=65536:65536
-e sonar.jdbc.url=jdbc:postgresql://x.x.x.x/sonar
-e sonar.jdbc.username=sonar
-e sonar.jdbc.password=DBPASSWORD
-v sonarqube_conf:/opt/sonarqube/conf
-v sonarqube_extensions:/opt/sonarqube/extensions
-v sonarqube_logs:/opt/sonarqube/logs
-v sonarqube_data:/opt/sonarqube/data
sonarqube:7.9-community

The container stops after about 8-10 seconds. The sonar.log has the following warning:
2021.04.12 21:37:04 WARN app[o.s.a.p.AbstractManagedProcess] Process exited with exit value [es]: 78

This message is usually displayed when there is a database migration pending. i think you were connected to the database in this run and would just have needed to navigate to /setup to start the database migration process.

there are other files in the logs directory which can give more information about why sonarqube stopped. as you noticed the es exit code, the assumption to look at the es.log file for an error.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.