How I switch between Community and Developer Edition of SonarQube on Windows 11

Background

Tech Notes

--

I have some projects set up with SonarQube community edition and quite a few of them. It will take me some time to transition them all to the developer license, which will leave me in a state in the interim where I’ll have to ‘dual-boot’ so to speak between the two editions.

This is the quick easy hack I came up with for doing so.

Context

You cannot run more than one SonarQube at a time if you want them both to serve port 9000 (the default port)

I didn’t feel like configuring it to have 1 on port 9000 and the next on port 9001 partially because I knew they would all eventually be moved to the developer edition.

Setup

In the root folder of my C:\ drive I have these three folders

the sonarqube folder contains the community edition, and the one labelled “sonarqube-developer-9.4.0.54424” contains the developer edition.

The Registry

You can set the path to which sonar qube script will execute on boot in your registry.

Hit Windows Key + R to open the run window and type “regedit” as the command. This will open your registry editor.

You can see below the path to the sonarqube registry settings. Here it is below for you to copy and paste:

Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SonarQubeService

Here you will find a property “ImagePath” you can change that property to point to the edition of the StartSonar.bat file of the version of SonarQube that you want to run on boot.

I’ve also seen things like this for ImagePath:

"C:\sonarqube-developer-9.9.1.69595\bin\windows-x86-64\lib\SonarServiceWrapper.exe"

If you haven’t joined Medium but would love to, click here. By signing up for Medium through my referral link, I will receive a small commission.

--

--