Peter Burrows
Peter Burrows

Reputation: 23

How do you replicate rules between SonarQube servers?

We currently have two SonarQube servers (v4.5.1) running on two separate Windows 2012 servers each with its own MS SQL database server. One is our Development server and the other is our production server. The idea being that we test out all rule changes on the development server first, once we are happy that they are correct we port them to the Production server.

When we first setup the two servers we simply took a backup of the Development server database and restored it on the Production server. At this point both systems were in sync.

We have recently made some modifications to the Development rules set, however when we tried the same approach to move these to the production server it did not work.

The production box seemed to remember the previous rule set. There seems to be a cache of the previous rules that we can't work out how to clear.

Before restarting SonarQube with the new DB in place we deleted the temp folder as that appears to keep a cached H2 database, but that did not solve the issue. We also tried starting it up and using the /setup url but this did not appear to work either.

Is there a way to completely reset the SonarQube server prior to restoring the database so that it has no knowledge of the previous rule set?

Alternatively is there a better way to export and re-import the entire rule set between two servers?

We looked at exporting the rule profile, but this did not appear to contain the full detail of the rules.

Thanks Pete

Upvotes: 2

Views: 1160

Answers (1)

For the moment, this is not possible to fully synchronize rules and quality profiles between 2 servers because of SONAR-5366. You can watch and vote for this ticket.

Concerning the cache that you seem to have, this is probably the E/S indexes which are located in <install_dir>/data/es folder. What you can do is:

  • stop you server
  • fully delete the <install_dir>/data folder
  • restart the server: your rules should be in sync with the DB

Upvotes: 3

Related Questions