mysqlpostgresqlupgradesonarqube-ops

Upgrade Sonarqube 6.5 to 7.1 and also migrate from old server and database


I have an instance of Sonarqube 6.5 (with MySQL) running on a old server. I'd like to upgrade this instance and at the same time move to a new server with PostgreSQL.

Based on the upgrade docs, I have to first upgrade to 6.7.3 (LTS) version and then I can upgrade to 7.1 (latest at the moment). My challenge is the data migration.

I've setup a sonarqube 6.5 instance on my local machine using docker. My plan is to upgrade the versions in my local instance and then migrate to the new server. I'm also using MySQL here. So, setup is almost same as production. I took a mysqldump from the production server and imported the data in my local MySql instance by running mysql -u sonar -p < dump.sql.

After restarting sonarqube on my local environment, I don't see any of my projects and their data. It seems the database has the new data, because the default admin password changed after importing mysqldump. Also noticed that if I log in as Admin and then browse to "Administration -> Projects -> Management", I see all the projects listed there. I can also browse the code, but still don't see any of the issues even though the dashboard shows number of bugs, coverage, etc.

I tried copying over the sonarqube data directory from the production server to my local instance and then restarted sonarqube, but that didn't seem to make any difference.

Please advise. Thanks a lot.


Solution

  • For the original issue of projects/issues data not showing up, just had to delete the $SONARQUBE_HOME/data/es5 directory. Sonarqube will regenerate this. Found the answer from this thread.

    Newly upgraded Sonar not showing projects or users