ZIP installation migration guide
ZIP installation is still available, but it will be removed in a future release. This guide helps you migrate your SonarQube Community Build instance to a container-based deployment.
Introduction
We recommend installing SonarQube Community Build with the Docker image or the Helm chart. ZIP installation is still available, but it will be removed in a future release. See the deprecation policy for details.
We recommend migrating to a containerized deployment. Containers give you a consistent, reproducible environment and simplify updates. Choose the option that fits your infrastructure:
From Docker image: Suited to single-host deployments.
On Kubernetes or OpenShift: Suited to teams that already run Kubernetes or OpenShift.
This guide walks you through switching your existing ZIP installation to the deployment option you choose. Your data stays in your existing database: you carry over your configuration, start the container against the same database, verify the result, and roll back if needed.
How the migration works
All your SonarQube Community Build data (projects, issues, quality profiles and gates, users, permissions, and settings) is stored in the database. The migration does not move that data: you stop the ZIP instance and start a container that connects to the same database.
The container rebuilds its search index from the database at first start. You do not copy the ZIP's data directory.
Before you start
Use the same SonarQube Community Build version: Deploy the container image or Helm chart that matches your ZIP version exactly, including the build number, for example
sonarqube:26.10.0.133078-communityfor a ZIP 26.10.0.133078. Do not combine the migration with an update. If you also want to update, do it as a separate step before or after the migration. See Update.Use an external database: If your ZIP instance uses the embedded H2 database, you cannot migrate it. See H2 database not recommended in production.
Back up your database: See Backup and restore. It's your rollback point if something goes wrong.
Check that the database is reachable: Make sure the container network can reach the database, using the hostname you plan to use. See the Keep the JDBC URL identical requirement for more information.
Keep the JDBC URL identical: SonarQube Community Build computes its Server ID from the database and the JDBC URL. If the URL string changes, even if it still points to the same database (for example
localhostto a service name or an IP address), the Server ID is reset at startup. The log shows:Server ID is reset because it is not valid anymore. Database URL probably changed. The new server ID affects SonarSource licensed products.Moving to a container does not change the Server ID by itself; only a different JDBC URL does. The Server ID identifies your instance, and you need it to get a license if you later move to a commercial edition of SonarQube Server. See System info and server ID for more information. Do not replace the database host with an IP address or
host.docker.internalunless a new Server ID is acceptable to you.If the hostname in your URL does not resolve from the new environment, make it resolve to the database there, for example with
--add-host(Docker),extra_hosts(Docker Compose), orhostAliasesor anExternalNameService (Kubernetes).If your URL uses
localhost(database on the same host as the ZIP instance),localhostinside a container points to the container itself:Docker on Linux: Run the container with host networking (
--network host, ornetwork_mode: hostin Docker Compose).localhostthen reaches the database on the host and the URL stays the same.Kubernetes: A pod cannot reach the database through
localhost. You must change the URL, which resets the Server ID.
What to carry over
Go through your $SONARQUBE_HOME/conf/sonar.properties, $SONARQUBE_HOME/extensions/, and any environment variables set on the ZIP host. Every non-default setting must be moved to the new deployment.
sonar.jdbc.url, sonar.jdbc.username
SONAR_JDBC_URL, SONAR_JDBC_USERNAME
jdbcOverwrite.enabled: true, jdbcOverwrite.jdbcUrl, jdbcOverwrite.jdbcUsername
sonar.jdbc.password (plain or {aes-gcm} encrypted)
SONAR_JDBC_PASSWORD
Kubernetes secret referenced by jdbcOverwrite.jdbcSecretName and jdbcOverwrite.jdbcSecretPasswordKey
Encryption key (~/.sonar/sonar-secret.txt or sonar.secretKeyPath)
Mount the file and set SONAR_SECRETKEYPATH
Kubernetes secret with the key sonar-secret.txt, referenced by sonarSecretKey
sonar.auth.jwtBase64Hs256Secret
SONAR_AUTH_JWTBASE64HS256SECRET
sonarSecretProperties (secret with the key secret.properties). See Storing sensitive properties in a secret.
Other properties (for example sonar.web.javaOpts, LDAP, proxy). See List of system properties for each property. The environment variable is the property name in uppercase, with dots replaced by underscores.
The property's environment variable, for example SONAR_WEB_JAVAOPTS
sonarProperties, or sonarSecretProperties for sensitive values
Plugins in extensions/plugins
Copy the JAR files to the extensions volume
plugins.install (list of download URLs). See Installing plugins.
Oracle JDBC driver in extensions/jdbc-driver/oracle
Copy the JAR file to jdbc-driver/oracle in the extensions volume
jdbcOverwrite.oracleJdbcDriver.url (download URL of the driver)
data/ directory
Do not copy. Use an empty data volume.
Do not copy.
logs/, temp/
Do not copy.
Do not copy.
Notes:
Encrypted settings: If any setting, in
sonar.propertiesor in the database, is encrypted ({aes-gcm}…or{aes}…), you must bring the same encryption key. Without it, SonarQube Community Build cannot decrypt the database password and stops at startup withFail to decrypt the property sonar.jdbc.password. Please check your secret key.Encrypted values can be passed unchanged through environment variables and Kubernetes secrets. See Sensitive settings and Encrypting Helm chart sensitive data.JWT secret: If you set
sonar.auth.jwtBase64Hs256Secreton the ZIP instance, reuse the same value so that users stay logged in. If you did not set it, users have to log in again after the migration. See Defining a JWT token.Plugins: Check that each plugin is compatible with your version. See Plugin version matrix.
Oracle: If you use an Oracle database, the container needs the JDBC driver. Without it, SonarQube Community Build stops at startup with
Directory does not exist: extensions/jdbc-driver/oracle.Container user (Docker): The Docker container runs as user ID 1000. Files you mount or copy (encryption key, plugins, JDBC driver) must be readable by that user. On Kubernetes and OpenShift, these come from secrets or are downloaded at startup, so this does not apply.
Migrate to Docker
Prepare the Docker host. See Prepare the Docker installation. On Linux, set the kernel limits required by Elasticsearch and make them persistent:
Create the volumes and copy your plugins, and your Oracle JDBC driver if you use Oracle, into the extensions volume:
Copy the encryption key to the Docker host, for example to
/etc/sonarqube/sonar-secret.txt, readable by user ID 1000.Stop the ZIP instance and make sure it cannot restart, for example:
Start the container with the same JDBC URL and the settings you collected, using
docker runor Docker Compose. If your JDBC URL useslocalhost, replace the port mapping with--network host(ornetwork_mode: host). See Before you start.
Follow the logs until you see
SonarQube is operational:
Migrate to Kubernetes or OpenShift
Check the prerequisites in Before you start.
Create the namespace, add the Helm repository, and create the secrets. The Helm chart requires a monitoring passcode, so you also create a secret for it. See Setting up with Prometheus server for more information.
Create a
values.yamlfile:plugins.installandoracleJdbcDriver.urldownload the files at startup, so the pod needs network access to the URLs. For plugins, use the download URL of the plugin version you run, from the plugin's release page. If the cluster has no access to these URLs, build a custom image that includes your plugins. Keep the defaultresourcesunless you have sized them deliberately: SonarQube Community Build runs three processes in the pod.On OpenShift, set
OpenShift.enabled: trueinvalues.yaml. See Example: installing on OpenShift for more information.Stop the ZIP instance and make sure it cannot restart.
Install the chart.
community.buildNumberdeploys the same version as your ZIP installation. See Installing Helm chart.Follow the logs until you see
SonarQube is operational:
Verify the migration
The logs show
SonarQube is operationalandGET /api/system/statusreturnsUP. The instance must not ask for a database migration (statusDB_MIGRATION_NEEDED, or the/setuppage). If it does, the image version does not match your ZIP version. Do not start the database migration. Stop the container and deploy the matching version.The log shows the same Server ID as the ZIP instance (
Server ID: …).The background indexing has finished (Administration > Projects > Background tasks). After it finishes, your projects, issues, and issue statuses (accepted, false positive) are visible as before.
Users can log in. Plugins are listed in Administration > Marketplace > Installed.
Run an analysis from your CI pipeline and check that it succeeds.
After you verify everything, update your DNS, reverse proxy, or load balancer to point to the new deployment, then decommission the ZIP host.
Roll back
As long as you used the same SonarQube Community Build version, you can go back to the ZIP instance:
Stop the container (or
helm uninstall).Delete the ZIP instance's
$SONARQUBE_HOME/data/es*directory, so that the search index is rebuilt from the database and includes the changes made while the container was running.Start the ZIP instance.
If the database itself is damaged, restore your backup before you start the ZIP instance.
Related pages
Last updated
Was this helpful?

