0

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.

aver
  • 555
  • 2
  • 7
  • 21
  • Afte a lot of trial and error, I was able to get it to work. I think my problem was mismatched mysql version. The mysqldump from prod server was running mysql version 5.7.20 and in my local env I was using latest version of mysql. After using the same version, I was able to get it to work and go through the upgrade path (6.5 - > 6.7.3 ->7.1). After upgrading to 7.1, I'm taking another mysqldump for backup, but I noticed this time the size of the dump file is much smaller. The mysqldump from version 6.5 was about 2GB where as after upgraeding to 7.1, it's about 600MB. Is that expected? – aver May 02 '18 at 21:46
  • Is it possible that the size of the mysqldump after upgrading to 7.1 is smaller because I haven't run es index yet? – aver May 02 '18 at 21:49
  • After upgrading to version 7.1, I used pgloader to load the database from mysql to postgresql 10.3. Now I setup Sonarqube 7.1 connected to this postgresql database. And I have the original issue. If I login as Admin and browse to `Administration -> Projects -> Management`, I can see all the projects. But, otherwise I don't see any of the projects or their issues. – aver May 03 '18 at 02:51
  • Regarding the projects/issues not showing up problem, found the fix in this thread. Basically just needed to delete the sonarqube-data/es5 directory and let sonarqube regenerate it. https://stackoverflow.com/questions/44408205/newly-upgraded-sonar-not-showing-projects-or-users – aver May 03 '18 at 03:52

1 Answers1

0

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

aver
  • 555
  • 2
  • 7
  • 21