How to upgrade SonarQube + database migration using self hosted Enterprise Edition

Hey Steven!

The mysql-migrator will do the hard job of moving all your data from MySQL to whatever your new database engine is.

However, the mysql-migrator will not migrate the schema (tables, indices, etc.) from one database to another. As a result, you need to first start a SonarQube instance against your target database using the same version as your current SonarQube version. This will create the schema on your target database, which is then primed to have data transferred into it.

Whatever happens to that “second instance” is up to you (it would work just as well if you stopped your Production instance and started it against your target database, but by using a second instance, you can do that before you take your maintenance outage to actually migrate the data).

I think that most users shut it off and then update the sonar.jdbc.url of their primary instance, and start their primary instance (which might have important plugins or additional configuration).

The migration will work whether or not a valid license is applied, but any analyses submitted won’t work until a license is applied.

When you migrate your Production instance – your server ID will change because a new Database URL will be used. You will need a new license at that time (and you can talk to your account representative about a temporary license that will cover all Server IDs until you have your new Server ID in hand)

1 Like