Upgrading SonarQube tool
After upgrading the platform version, if you are prompted about new toolchain versions, you can upgrade tools based on your actual situation.
Note:
- After upgrading the platform version, if there is a newer version available, you need to manually upgrade based on your business scenario.
Upgrading to 9.9.5
Note:
- When there is a large amount of existing data in SonarQube, this step may take a considerable amount of time. Since the upgrade process involves database version upgrades and SonarQube data version upgrades, when the data size is large (e.g., over 10 GB), the total upgrade time may reach 2-3 hours.
Procedure
-
In the left navigation panel, click Toolchain > Instances.
-
If the instance name displays
, click the instance name.
-
Click Actions > Upgrade.
During the upgrade process, click the icon to view the real-time status of the instance update.
Upgrade to 9.9.5.1
Note:
-
In this version and subsequent versions, an internal single-instance database will no longer be supported. Therefore, before upgrading to this version, prepare an external PostgreSQL (supported versions are PostgreSQL 11 to 15) with an empty database and sufficient storage space. After triggering the upgrade, the data from the original database will automatically migrate to the new database provided by the user.
-
During or after the upgrade process, you can view a Job named
sonarqube-pre-migrationin the list of instance components. By viewing its logs, you can see the steps and error logs during the data migration process (if any errors occur, the Job will exit proactively and clearly indicate failure; if the Job succeeds, it means the migration has been completed successfully without error logs). -
Due to data migration, for a database larger than 10GB, this step typically takes more than 20 minutes.
-
This version can only be upgraded from 9.9.5. For other versions, first upgrade to 9.9.5, then proceed with the content in this section to upgrade to 9.9.5.1.
Steps
-
Prepare a Postgresql database with a version between 11.x and 15.x. You can create this via the platform’s Data Service > Postgresql. Create a PostgreSQL instance
-
In the left navigation panel, click Toolchain > Instances.
-
If the instance name displays
, click the instance name.
-
Click Actions > Upgrade.
-
To upgrade to this version, you need to fill in the database secret. If you do not have a secret yet, click on “Create Secrets”, then fill out the secret form on the popup page. Choose the type as Opaque, and enter the following fields into the secret:
Field Description host The database connection address port The database connection port username The database account username password The database account password database The database name, the database should exists and be empty sslmode Is SSL enabled for the database connection? Enter enableto enable ordisableto disable, default is enabledThe Postgresql instances created through the Data Service have SSL connections enabled by default. If you use the Data Service Postgresql instance, set
sslmodetoenable. In other cases, check with your server’s configuration to confirm whether SSL connections are supported.After filling out and submitting the Secret creation, return to the SonarQube upgrade page and use the Secret to continue the upgrade.
During the upgrade process, click the icon to view the real-time status of the instance update. If the following error messages appear, it means that there is an error in your Database Secret.
Error Message Description required postgres database name, got empty dbname from provided secret No database name was entered, the user needs to specify an existing empty database Connection refused. Check your host and port in the given secret Connection creation failed, check if the address and port are incorrect Authentication failed. Check your username and password in the given secret Server rejected the connection, check if the username or password is incorrect SSL is not enabled on the server, please change ‘sslmode’ to ‘disable’ in secret if this server is the right one to connect The server does not support SSL connections, set sslmode to disableserver asks for an SSL connection, please change ‘sslmode’ to ’enable’ in secret if this server is the right one to connect The server requires an SSL connection, set sslmode to enableget secret “ns/secret” failed, please check if it exists Failed to get the secret, check if the secret have been created successfully Please check and correct the information in the corresponding secret based on the error message. After making corrections, the component will re-check the secret within 1 minute. If it is correct, the upgrade will continue to finish.
Once the deployment status become Deployed, verify the tool’s accessibility by accessing the URL.