Update from 7.1 to 7.7 creates new database

I have a SonarQube Community instance running version 7.1 on a Windows Server 2016 VM with SQL Server 2016 Express. After following the steps in the upgrade document, I start up the new SonarQube 7.7 instance and after the initial setup has completed, none of my data or plugins have migrated over. It’s like I’m starting a brand new instance of SonarQube, even though I have copied my compatible plugins (in this case, just one AAD plugin) and updated the sonar.properties document. My admin login resets back to the default, and all of the data within my database including all of the groups I have created in 7.1 are gone.

The odd thing is, when I attempt the upgrade in my sandbox environment using an exact duplicate of the production environment, it works as expected.

Has anybody seen this before?

Hi @oc3lot.

That’s odd. Are you sure it’s connected to SQL Server? Do you see a warning in the footer mentioning the embedded H2 database? If not, can you check the data in the database manually? Is it connected to the correct database? Is your old data still there (it should)?

1 Like

Positive that it’s connected to SQL Server. I have verified by creating a new group in the updated Sonar server, which is shown in the database. No embedded database warnings.

Old data gets wiped on upgrade. I follow the same steps using the same configurations on our Sandbox and it works no problem.

We’re starting to suspect it may have have something to do with a GPO, and are investigating.

Just following up on this…

Still having the problem, and it’s preventing me from upgrading past 7.1. Running SQL Express 2017. Here is what I’m doing during the upgrade from 7.1 to 7.7:

Before upgrading, I verify Sonar 7.1 is connected to my SonarQube database. All groups and projects are present in the database.

  • Backed up Sonar database
  • Stop Sonar 7.1 Service
  • Uninstall Sonar 7.1 Service
  • Verify sonar.properties is configured to connect to the existing SonarQube database.
  • Install Sonar 7.7 Service
  • Delete ‘Data’ folder in Sonar 7.7 folder (in other threads I’ve read, this has fixed the issue with users and projects disappearing)
  • Start Sonar 7.7 Service

Once the service has started, I navigate to localhost:9000/setup, and receive a notification that the database is already up to date. This then leads to a ‘SonarQube is starting’ screen. During this time, my SonarQube database is completely wiped clean and when I log in, all users and projects are gone.

Surely I can’t be the only one with this issue. Any help would really be appreciated.