SonarQube database migration via textual database dump

Hello,

We’re looking to migrate data from our existing database (postgres 10) to another (postgres 12). They live in separate private networks and there is no easy way for us to run the migration tool from a box that’s connected to both. I’m curious if it is possible to perform a migration manually through textual database dumps? I.e. something like pg_dump → copy to new server → pg_restore? SonarQube version is 8.5.0.37579.

Thanks,
Michael

Hi Michael,

First, your version is past EOL. You should upgrade to either the latest version or the current LTS at your earliest convenience. Your upgrade path is:

8.5 → 8.9.2 → 9.0.1 (last step optional)

Regarding your actual question, this is really a DB question & totally outside of SonarQube. However you handle the migration, under the assumption that your schema & data look the same before & after, the SonarQube side should only be a matter of updating your JDBC URL and restarting SonarQube.

 
HTH,
Ann

Thank you for the quick reply Ann; understood, I can experiment with the manual DB export & import at our own risk. Assuming the schemas and tables are identical after the migration, will the server realize it’s pointing at a new database, and gracefully asks for a new license key (I forgot to mention we are on an Enterprise license)?

Michael

Hi Michael,

TBH I don’t remember the details of this. I believe that since it’s the same data, just in a new place, this might work seamlessly. In any case, even if you do need a new license key, that should be the only hiccup assuming your data move goes smoothly.

And remember, assuming you don’t wipe the old DB out, if there’s a problem with the new DB you can always switch SQ back to the original DB just by changing the JDBC URL back.

 
Ann

Hi Ann,

Got it, thank you very much!

Michael