# Sonar Upgrade and DB Migration

**URL:** <https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104>\
**Category:** SonarQube Server / Community Build\
**Created:** [May 5, 2020, 2:08am UTC](https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104 "2020-05-05T02:08:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpenaflor23](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jpenaflor23/32/11446_2.png) [@jpenaflor23](https://community.sonarsource.com/u/jpenaflor23)\
**Post date:** [May 5, 2020, 2:08am UTC](https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104/1 "2020-05-05T02:08:51Z")

</div>

Must-share information (formatted with [Markdown](https://commonmark.org/help/)):

- which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
- what are you trying to achieve
- what have you tried so far to achieve this

Hi,

I am fairly new to Sonar server configuration. Currently we are using Sonar 6.7.7 and MySQL as the database back end. Since both our Sonar version and MySQL is no longer supported I need to upgrade our version and migrate MySQL data to PgSQL. I was able to covert the data to PgSQL using “pgloader” and tested the data using Sonar 6.7.7-Community. But somehow when I run Sonar 8.2, Sonar seems to wipe out my data in PgSQL and it creates new tables. It does not happen when I use Sonar 6.7.7. I would like to seek advise on how can I run latest Sonar Version and also retaining the DB dump I have from MySQL.

By the way I am using Docker for Both Sonar and PgSQL.

Thank you in advanced for the help.  
Jimson

---

<div class="post-metadata">

**Author:** ![ganncamp](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/ganncamp/32/1261_2.png) [@ganncamp](https://community.sonarsource.com/u/ganncamp)\
**Post date:** [May 5, 2020, 7:42pm UTC](https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104/2 "2020-05-05T19:42:36Z")

</div>

Hi Jimson,

Welcome to the community!

I have no experience - either real or by reputation - with pgloader. However, we’ve created a [free migrator to get you off of MySQL](https://community.sonarsource.com/t/end-of-life-of-mysql-support/8667). I suggest you give it a try and come back to us if you’re still having problems.

&nbsp;  
HTH,  
Ann

---

<div class="post-metadata">

**Author:** ![jpenaflor23](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/jpenaflor23/32/11446_2.png) [@jpenaflor23](https://community.sonarsource.com/u/jpenaflor23)\
**Post date:** [May 6, 2020, 10:02am UTC](https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104/3 "2020-05-06T10:02:07Z")

</div>

Hi,

Thank you for checking on this. I was able to fix my issue when followed suggestion from “[https://stackoverflow.com/questions/58726379/sonarqube-update-6-7-to-7-9-empty-tables](https://stackoverflow.com/questions/58726379/sonarqube-update-6-7-to-7-9-empty-tables)” to add schema value in the sonar.jdbc.url configuration for Sonar. After defining the db schema, I was able to access sonar setup and Sonar did the rest of the upgrade.

Additional Step I made is to delete “\<Sonar\_Home\>/data/es\*” when I cannot see my projects from the home page. Both steps requires Sonar to restart and apply the changes.

Thank you again for the support.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/sonarsource/user_avatar/community.sonarsource.com/system/32/31083_2.png) [@system](https://community.sonarsource.com/u/system)\
**Post date:** [May 13, 2020, 10:02am UTC](https://community.sonarsource.com/t/sonar-upgrade-and-db-migration/24104/4 "2020-05-13T10:02:11Z")

</div>

Closed on May 13, 2020, 10:02am UTC

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
