8.9 | Instance administration | Project move

Was this page helpful?

On this page

Start Free

Project move

Project move allows you to export a project from one SonarQube instance and import it into another SonarQube instance. To use project move, you must have Administer permission rights on the project in the source instance, and access to the file systems of both instances.

When to use project move

In the following cases:

  • You want to create a central SonarQube instance at the enterprise level and you want to keep the history created on N instances used previously at the team level.
  • Your company is acquiring another company that already has a central SonarQube instance.
  • An application is transferred from one team to another in a large company and that company has several SonarQube instances.

Prerequisites

In order to be able to export and then load your project's data, the two SonarQube instances must have:

  • The exact same version.
  • The same plugins with the same versions.
  • The same custom metrics.
  • The same custom rules.

How to export

On the source instance:

  • Reanalyze the project one last time to make sure it is populated with data corresponding to your current SonarQube installation.
  • Navigate to the project and at the project level, choose Project Settings > Import / Export.
  • Select the Export button to generate a zip file containing the settings and history of your project (but not the source code). Note that if you need to change the project key, you must do it before performing the export.

A zip file containing all project data ex is generated in <SONARQUBE_HOME>/data/governance/projectdumps/export/ named <PROJECT_KEY>.zip.

How to import

On the target instance:

  • With a user having the Administer System and Create Projects permissions, go to Administration > Projects > Management and provision the project using the same key the project had in the source instance.
  • Configure the project permissions, and the quality profiles and quality gate associated with the project.
  • Put the generated zip file into the directory <TARGET_SONARQUBE_HOME>/data/governance/project_dumps/import.
  • Go to the project Home Page and choose Project SettingsBImport / Export.
  • Select Import to start importing your data.
  • Source code is not included in the zip file. Once the import is finished, trigger an analysis to import source files into the new instance.

Notes:

  • If the import is successful, the zip file will automatically be deleted.
  • It is not possible to import a Project that has been already analyzed on the target instance.
  • Security reports in an imported project will be empty until the analysis has run.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License