SonarQube 6.7.4 Upgrade to 8.9.6 LTS inclluding MYSQL to Postgres migration

We need to upgrade from 6.7.4 to 8.9.6 LTS, which includes migrating from MYSQL to Postgres. From what I have gathered, there are two tools for migrating the data from existing mysql DB to new Postgres DB. One is mysql-migrator, and the other which comes with SonarSource support, is DB-Copy (SonarQube DB Copy Tool | SonarQube Docs).
I like to know which one is recommended, there is not a whole lot of documentation on mysql-migrator.
Also what would be the cost of SonarSource? We have two instances of sonarqube.

Hi @zservati

There are 2 things in your post : upgrade and DB change.

To upgrade from 6.7 to 8.9, you need to go through this path : 6.7 → 7.9 ex-LTS → 8.9.6 current LTS.
As mentioned here, please read carefully the notes before upgrading to avoid any surprises :slight_smile:

For your DB migration, I encourage you to read this old post that was published when MySQL support went to an end : End of Life of MySQL Support
You will find the requested information.
The tool to be used is mysql-migrator.

Hope this will help,
Have a nice journey through SonarQube versions and happy to see you soon on 8.9.6 LTS!



Thhank you. What version of PostGres do we need to installed? Is there any document for PostGres installation including hardware requirements?


you’ll find all requirements here: Prerequisites and Overview | SonarQube Docs
including PostGreSQL versions.

1 Like

Thanks.I am trying to download 7.9.6 on Download | SonarQube page, but it cannot connect to the server. Is there an issue with the download link.

Hi @zservati ,

On the Downloads page, scroll down to “Show all versions” buttons and click on it. Then scroll down to SonarQube 7.9.6 and click on the edition you need.

If that doesn’t work, you can download directly from here:

Documentation for mysql-migration is here: GitHub - SonarSource/mysql-migrator: Command line tool to migrate MySQL database of SonarQube 6.7-7.8 to non-MySQL

1 Like

I have another question. To migrate our mysql DB to PostGres with the existing SQ 6.7.4, from the documentation I see I need to install PostGes 9.x (?) and after having SQ 6.7 working with the PostGres, then to upgrade SQ 6.7.4 to 7.9 LTS, it seems I need to upgrade DB to PostGres 10. Is that correct?

I suggest installing just PostgreSQL 9.6 only.

Make sure to install PostgreSQL 9.6 with SonarQube 6.7.4, because you can stay on PostgreSQL 9.6 for the SonarQube 7.9 upgrade and the SonarQube 8.9 LTS upgrade. Then you can upgrade PostgreSQL to a higher version if you want.


I see some people have been using PostGres 10, and also 9.6 since to be EOL so we need to upgrade.

1 Like

Yes, I would upgrade to at least PostgreSQL 10 after you finish the SonarQube upgrades. Make sure to take DB backups and test your upgrades in a lower (test/staging) environment if possible.

I will, thank you!

Hello, I upgrade our existing mysql db with sonarqube 6.7.4 to PostGres 9.3, and transferred the data using mysql-migrator by following the steps on the documentation, including removing the data/es5 dir. Everything went well, and the data got copied successfully, but after logging into the sonarqube, and click on projects tab, I cannot see any project, it’s basically empty. I am also not to be able to search for any project, including the one that got upload after migration. However under administration/project tab I see the projects. Would you please give me some insights as what might have gone wrong. Thanks

Please verify that you have set the correct sonar.jdbc.url in your file. Please verify there is data inside that database.

Please zip and attach the $SQ_HOME/logs folder here if still need assistance.

sonar.log (5.6 KB)

Please see the sonar.log in the attachment above. I have verified that the database is not empty and table size corresponds to the mysql db. Also as I mentioned when click under administration/projects tab I can see projects. However the project search is not working either. I have already verifed the jdbc url and user/pw. They are all correct and no db connection issue. I have been able to upload a project to the sonarqube, and been able to access it via https:///dashboard/index/.

I believe I resolved the issue. I stopped sonarqube, and I deleted the data/es5 folder under sonarqube home, which caused sonarqube to rebuilt the indices.
So the delete of data/es5 needs to be done after copying data via mysql-migrator.
Is that correct?

1 Like

Yes, you should reindex your projects after an upgrade or a major change like your mySql to PostgreSQL conversion.

Thank you!

1 Like

Hi, Finally the db migration to postgre is done. Now I am ready to upgrade from 6.7.4 to 7.9 LTS, as part of the migration to 8.9LTS.
I like to know if the quality profiles, web hooks and etc all will be copied as part of the upgrade. All I have seen in the upgrade notes is after copying the configuration, then start the server, and then go to the setup URL. and then need to upgrade the plugins as needed. Is there anything else.