Upgrade from 8.2-developer to 8.4

Hello, i am looking for some general information on upgrading from 8.2 to 8.4. I have read the upgrade steps. The steps are for manual upgrade. My question is more for automated update. We currently use elasticbeanstalk to deploy sonar docker image. It is setup as an immutable deploy. This means that if i kick off a new deploy to upgrade the docker image to sonarqube:8.4-developer. It will spin up a new instance and deploy that image. Your upgrade steps do not really cover automated options.

We have a fairly simple setup. beanstalk app for sonarqube 8.2-developer and it is backed by RDS running postgres. We deploy via circleci. In our deploy scrip we have setup the necessary steps to apply various system settings that are needed for es.

Would my upgrade break anything? since in the upgrade steps there are various manual steps.

Thank You

Hi @Ash ,

The only real manual step is the database migration and this step can be automated as well. i am a little bit confused about your setup thou. do you have one sonarqube instance that is just started (or in the immutable case created) on demand with one persistent RDS Database behind it or do you have multiple sonarqube instances running? if the second one is the case please make sure that you only connect one instance to one database at a time.

back to the automation question: i would suggest that you take a look at the API of sonarqube. your deployment could look something like this:

  • deploy new docker image
  • wait until sonarqube is responding on the web port (can take a minute)
  • check the status of sonarqube using the API endpoint /api/system/status
  • if the status returns DB_MIGRATION_NEEDED trigger the endpoint /api/system/migrate_db
    • wait until the database migration is completed
    • trigger a little bash script that connects to the database and runs VACUUM FULL on your database
  • if the status returns just UP, no database migration is needed
  • done

hope that helps you to automate the continuous deployment of sonarqube in your infrastructure. if i have misunderstood your intention please let me know (:

1 Like

Hi Tobias

thank you for the response. We have one sonarqube instance backed by a single RDS instance. Our deployment policy is Rolling with additional batch. Though it seems like this is going to be a problem. With this policy it will create a new instance and deploy new docker image which will try to connect to the db, while the old instance is still connected to the same db. Rolling with batch makes sure the new instance is healthy before terminating the old instance. I believe this may be an issue since two instance cant connect to the same db for sonar.

On a side note do you guys provide any type of test license? So we can spin up test env.

Hi @Ash ,

yeah that will lead to a problem as it can happen that there are database migrations during a update which will end in a corrupted database, so i would not recommend this :sweat_smile:
when you are worried about uptime i would suggest that you move to our LTS release, so updates occur less frequent. while we currently do not have official docker images for the paid tiers for the current LTS we will have them for the next LTS which will land in the beginning of next year

you can request a trial license from our homepage for the specific tier you want to evaluate. a list of tier and the benefits they have can be found here where you can also request the trial license

  • what if i remove immutable deployment and we don’t care about uptime.
  • kick off an update by updating the image from 8.2 to 8.4. This will replace the current container and update it with the new container. My assumption is this upgrade should just work. No manual intervention should be necessary. data migrations should just happen automatically.

you would still need to start the database migration via the api or in the web browser, but apart from that it could work