Upgrading SonarQube causes all projects and rules to disappear (with solution)

Upgrading from SonarQube 5.6.4 LTS to SonarQube 6.7.4 LTS using the upgrade instructions provided (https://docs.sonarqube.org/display/SONAR/Upgrading) causes all projects to disappear and all configured rules in quality profiles to be deactivated.

A solution is posted on StackOverflow (link) to delete the data and temp directories before the DB migration process. This fixed the issue for me.

Is this the correct way to solve this problem? If so, can the upgrade documentation be amended to include this step? This would have saved myself and others a fair amount of trouble.

Hi Michael,

Indeed, if removing the data directory has resolved your issue, it’s the right think to do.
About the documentation, if you follow the one related to LTS here, you’ll see that you need to use a new folder to install SonarQube, which means that by definition the data folder will be empty.

Note that starting 7.2 the data folder should be configured to elsewhere (see Configuring the Elasticsearch storage path in the installation guide), and it’s not more needed to drop it before upgrading.

Regards

1 Like

Hey Julien, thanks for the quick reply.

I did follow the instructions listed in the upgrade guide. It doesn’t look like the instructions have changed much since the LTS.

That’s nice to know that it’s suggested to configure the data directory on a separate system and that the data directory is explicitly for ES.

It looks like the ES index is getting initialized on first start-up and doesn’t get cleaned up during the database migration process. Given that the instructions say that SonarQube should not point to the database on first start-up during the upgrade, this means that the ES index won’t be populated with the correct database information. It would be helpful if the index were cleared and reinitialized during or after the database migration step.

Given that this is the LTS, it would be nice if this could be documented or fixed so that others don’t have to run into this same problem.