How to migrate the old projects to new version of SonarQube server

Hi All,
We are using SonarQube for one year and now the system recommend us to upgrade to newer version
However, we have build several analysis projects in the current Sonarqube server, just afraid how to backup these projects and migrate to the new version after Sonarqube upgrade?
Is any off-the-shelf tool?

Thanks.

Hi,

The upgrade procedure has you point your new version at your old database. Your projects are naturally and automatically preserved and moved forward to the new version.

 
HTH,
Ann

Hi Ann,
Understood and thanks for your information.

Fred

Hi Ann,
Sorry to bother you again.
Now I have upgrade the Sonarqube version to 10.2.1
After the server is started, I found the projects tab is empty.
There is no way to import from the database of previous version.
Note: The server revisions are installed on the different folder
Just wonder any method to copy the database to the new one?
Thanks.

Fred

Hi Fred,

Did you configure $SONARQUBE-HOME/conf/sonar.properties to point your new server at your old/existing database?

And, while I don’t expect there to be anything of interest in your server logs, it’s worth checking them.

 
Ann

Hi Ann,
No, I didn’t configure the database and left it as the default.
Could you advise the properties in sonar.properties need to be configured?
Please see the attached log file tar ball
sonar-log.tar.gz.zip (16.4 KB)

Fred

Hi Fred,

Per the docs (expand the Zip section):

  1. Update the contents of sonar.properties file (in <NEW_SONARQUBE_HOME>/conf) with the settings in the <OLD_SONARQUBE_HOME>/conf directory (web server URL, database, ldap settings, etc.). Do not copy-paste the old files. If you are using the Oracle DB, copy its JDBC driver into <NEW_SONARQUBE_HOME>/extensions/jdbc-driver/oracle

 
HTH,
Ann

Hi Ann,
Thanks for your info.
But we didn’t set the settings in sonar.properties before(web server URL, database, ldap settings, etc.).
There is no JDBC driver in <NEW_SONARQUBE_HOME>/extensions/jdbc-driver/oracle,too.
Could we copy the sonar.mv.db in <OLD_SONARQUBE_HOME>/data/ to replace the one in <NEW_SONARQUBE_HOME>/data/?

Fred

If I didn’t touch the sonar.properties before, you’re probably seeing this warning at the bottom of every page:

As it says, you can’t upgrade or migrate your data out of it into a different database engine. You’ll need to configure a “real” database and start from scratch.

1 Like

Hi Felipe,
Yes, we can see the warning in the bottom of the web page.
Now we understand the root cause and will start from the scratch to build the new projects on the DB.

Fred

1 Like