Cannot export/import project on SonarQube enterprise 9.9.4


We are running SonarQube enterprise 9.9.4 on both staging and production environment. Both have valid license.

Both environment are the same (deployed on K8S with helm chart) but have different data.

Basically staging is empty of any analysis data but project are provisioned and all configuration is similar (Configuration is all created via API).

We would like to export/import some project from prod to staging but the import fail even if all conditions are met

Basically we

  • Export zip on prod
  • Download zip localy (oc -n prod rsync sonarqube-enterprise-sonarqube-0:/opt/sonarqube/data/governance/project_dumps/export/ .)
  • Upload to staging (oc cp -n staging sonarqube-enterprise-sonarqube-0:/opt/sonarqube/data/governance/project_dumps/import/
  • Go to staging UI and import

But this fail due to constraint on new code

New codes are configured like this

Due to database size I would prefer to export/import project instead of full database

I can help debug this if needed.


Hey @jonesbusy

Is the New Code Period for the (empty) project something you’re also configuring via API?

Also configured via API. Only analysis data is empty.

Should I reset new code before import ?

I think that’s probably what is going on here – although we should fail much more gracefully (or just overwrite the new code period).

I’ll test this tomorrow. Thanks for your patience.

1 Like


I confirm if I reset the new branch to default to all branch the import work as expected.

It would be nice to to fail in such case and override the new code from the import. I will apply this workaround to not set the new code on my empty staging instance.


Hello @jonesbusy,

Thank you for confirming that it worked with the new code period reset. I tried on my side and checked the code to confirm this as well :white_check_mark:

In terms of a long-term solution, I’m more inclined to make this clear in the documentation rather than “complexifying” the feature with more checks and overriding capabilities. Something like “Don’t change any other configuration than Quality Profile and Quality Gate as it might fail the import”.
I’m suggesting this because it was the new code period here, but this can (could!) be valid for other pieces of configuration.

We are discussing/validating this internally, I’ll let you know about the decision.

Thanks for your report :+1:


1 Like

Hey @jonesbusy,

I again, just to let you know that we validated the documentation change stated above, vs. improving this particular feature. We’ll make it clear that no config (except QG and QP) should be changed for the import to happen, this both on the LTS and the latest versions.

Thanks for your report and help Valentin :wink:


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.