Migrating to SonarQube Cloud (formerly SonarCloud)

This guide is intended to help those considering and those performing a move from analysis with SonarQube Server / Community Build to analysis with SonarQube Cloud (formerly SonarCloud).

What you can’t migrate

If you’re considering a move to SonarQube Cloud, you should be aware of the limitations. There is no general data migration available:

  • You will lose all project history, including issue comments and FP/WF/Accept markings.
  • You will need to recreate your Quality Gates manually in SonarQube Cloud.

Migrating your custom Quality Profiles

However, it is possible to migrate your custom Quality Profiles:

  1. In SonarQube Server / Community Build, for each custom profile, navigate to the profile, then look for the vertical ellipses or hamburger menu and choose “Back up”, which will download your profile to file.
  2. In SonarQube Cloud go to your organization’s Quality Profiles page and choose Restore, where you will be prompted to upload your backup file. Note that SonarQube Cloud does not have prioritized rules, so that will not be present in your restored, SonarQube Cloud profile.
  3. Don’t forget to make your custom Quality Profiles the defaults for your organization

Updating your projects for the move

To move your project analyses to SonarQube Cloud, you’ll first want to import your projects from your DevOps platform (note that Monorepos must be imported slightly differently), and then update the analysis properties in your CI jobs:

  • change your sonar.host.url to https://sonarcloud.io
  • add sonar.organization=[your organization key]
  • update your sonar.projectKey value if what you imported with doesn’t match what you’ve used on SonarQube
  • update your analysis token, whether that’s a sonar.token analysis parameter, or a SONAR_TOKEN environment variable

Weigh-in

We’re considering adding migration functionality to SonarQube Cloud, but we need to hear from you to understand what type of information and configuration you would expect to be able to move. Visit our roadmap to tell us. Once you vote on the card, you’ll have the opportunity to add details about what’s important to you.

6 Likes