Data migration out of H2 Database

Dear Community,

I have been using SonarQube version 6.5 for my projects. I had been using the embedded H2 database and hadn’t used a separate database for storing the SonarQube analysis data.

I want to upgrade the version of SonarQube from 6.5 to 7.8 but SonarQube’s UI says I cannot upgrade without losing the data or migrate the data out of the installed SonarQube 6.5 and attach it with the upgraded database later.

How do I upgrade and still be able to save the data somehow? I know the official application says its not supported but is there a hack or something to save the data, as the data is really important.

If there is any possible alternative way for performing the upgradation so that I don’t lose data, please do suggest.

Regards,
Sid

Hi Sid,

You already know the official answer, so I won’t belabor it: you can’t migrate. You need to start over. (And maybe my answer will draw someone out of the woodwork to give you a hack and prove me wrong. Good luck, but I wouldn’t hold my breath…)

Now that that’s out of the way, I need to point out that 7.8 is past EOL. Since you’ll be starting over, you should do so with either 8.9.2, the current LTS, or 9.0.1, the Latest version.

 
Ann

Hi i want upgrade sonarqube db to psql from existing h2 db without any data loss how should i get my h2 data into psql db please need correct way to chnage db withou any data loss from h2 db.

@ganncamp I have managed to migrate to PostgreSQL from H2:

Do you want me to write a topic explaining how I did it? It´s not very difficult

I have written an article here explaining how I did it:

3 Likes