Skip to end of metadata
Go to start of metadata

  • UI Path: Project > Administration > Import / Export
  • Permission: you must have the "Administer" permission on the Project

When to Use "Project Move"

In the following cases:

  • you want to create a central SonarQube instance at 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 Administration > Import / Export
  • click on 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's key, you must to do it before performing the export.

The zip is generated in $SONAR_SOURCE_HOME/data/governance/project_dumps/export/ under the name <project_key>.zip

How To Import

On the target instance you must first provision the project before being able to load the data extracted from the source instance.

  • With a user having the "Administer System" and "Create Projects" permissions, go to Administration > Projects > Management and create the Project with the same key as in the source instance.
  • Configure the Project's permissions, and the Quality Profiles and Quality Gate associated to the Project
  • Put the generated zip file into the directory $SONAR_TARGET_HOME/data/governance/project_dumps/import
  • Go in the Project's Home Page and choose Administration > Import / Export
  • Click on the Import button 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 be automatically deleted, otherwise it will stay in the import folder,
  • It is not possible to import a zip on a Project that has been already analyzed on the target instance.

 

 

 

  • No labels