nativeInstallersonarqube

Upgrade SonarQube

Before running the commands shown on this page, you should load the Bitnami stack environment by executing the installdir/use_APPNAME script (Linux and MacOS) or by clicking the shortcut in the Start Menu under “Start -> Bitnami APPNAME Stack -> Application console” (Windows). On OS X VMs, the installation directory is /opt/bitnami and OS X VM users can click the “Open Terminal” button to run commands. Learn more about the Bitnami stack environment and about OS X VMs.

It is strongly recommended that you create a backup before starting the update process. If you have important data, it is advisable that you try to create and restore a backup to ensure that everything works properly.

  • Create a directory to save all the data you need to backup.

    $ mkdir ~/sonarqube-backup (on Linux and Mac OS X) $ mkdir ~/sonarqube-backup/httpd $ mkdir ~/sonarqube-backup/sonarqube

  • Back up the bitnami_sonarqube database as described on the PostgreSQL page.

  • Copy the Web server configuration and SonarQube configuration directories to your backup directory. You can use the commands below (on Linux and Mac OS X):

    $ sudo cp -rf installdir/apps/sonarqube/sonarqube/conf/* ~/sonarqube-backup/sonarqube $ sudo cp -rf installdir/apps/sonarqube/conf/* ~/sonarqube-backup/httpd $ sudo cp installdir/apache2/conf/server.crt ~/sonarqube-backup/httpd-ssl $ sudo cp installdir/apache2/conf/server.key ~/sonarqube-backup/httpd-ssl $ sudo cp installdir/apache2/conf/server-ca.crt ~/sonarqube-backup/httpd-ssl

  • Uninstall the previous Bitnami SonarQube Stack.

  • Download the latest version of the Bitnami SonarQube Stack and install it.

  • Restore the database backup as described on the PostgreSQL page.

  • Update the contents of the installdir/apps/sonarqube/sonarqube/conf/sonar.properties and installdir/apps/sonarqube/sonarqube/conf/wrapper.conf files with the settings of the related files in the installdir/apps/sonarqube-backup/sonarqube/conf backup directory. To do so, use an editor to modify them with the old settings (web server URL, database, LDAP settings, …).

    NOTE: Edit the settings files manually. Do not copy-paste the old files.

  • Restore the Apache configuration files in the new SonarQube stack. You can use the commands below. Note that the second command will restore the server SSL certificates from your previous server, so only execute this command if required.

    $ sudo cp -rf sonarqube-backup/httpd/* installdir/apps/sonarqube/conf $ sudo cp sonarqube-backup/httpd-ssl/* installdir/apache2/conf

  • Check if the plugins installed on the old stack are compatible with the new version of SonarQube by consulting the SonarQube compatibility Matrix. If any of them are incompatible, you need to install manually the latest version of these plugins as described in the Manual Plugins installation instructions.

  • Restart SonarQube using the graphical manager or the command line script:

    $ sudo installdir/ctlscript.sh restart sonarqube

  • Browse to http://localhost/setup and follow the setup instructions.

  • Analyze your projects (and compute your Views if you are the owner of the governance product) to get fresh data.

Upgrade only SonarQube in the Bitnami SonarQube Stack

  • Browse to https://www.sonarqube.org/downloads/ and find the link for the latest version of SonarQube.
  • Download the latest version using the link obtained in the previous step. For example (for version 6.3), run the commands below (on Linux and Mac OS X):

    $ wget https://sonarsource.bintray.com/Distribution/sonarqube/sonarqube-6.3.1.zip
    $ unzip sonarqube-6.3.1.zip
    
  • Backup your current SonarQube installation. You can use the command below (on Linux and Mac OS X):

    $ sudo mv installdir/apps/sonarqube/sonarqube/ installdir/apps/sonarqube/sonarqube-backup/
    
  • Substitute your old installation with the new version. You can use the command below (on Linux and Mac OS X):

    $ sudo mv ~/sonarqube-6.3.1/ installdir/apps/sonarqube/sonarqube
    
  • Update the contents of the installdir/apps/sonarqube/sonarqube/conf/sonar.properties and installdir/apps/sonarqube/sonarqube/conf/wrapper.conf files with the settings of the related files in the installdir/apps/sonarqube-backup/sonarqube/conf backup directory. To do so, use an editor to modify them with the old settings (web server URL, database, LDAP settings, etc.).

    NOTE: Edit the settings files manually. Do not copy-paste the old files.

  • Restore the permissions (Only on Linux and Mac OS X if the stack was installed as root).

    $ sudo chown -R root:sonarqube installdir/apps/sonarqube/sonarqube
    
  • Check if the plugins installed on the old stack compatible with the new version of SonarQube by consulting the Compatibility Matrix. If there is any of them that are incompatible, intall the latest version of the plugins manually as described in the Manual Plugins installation instructions.

  • Restart SonarQube using the graphical manager or the command line script:

    $ sudo installdir/ctlscript.sh restart sonarqube

  • Browse to http://localhost/setup and follow the setup instructions.

  • Analyze your projects (and compute your Views if you own the Governance product) to get fresh data.

Last modification July 4, 2019