SonarQube data migration from 7.9 to 8.6

I’m trying to upgrade sonarqube version 7.9 to 8.6 and migrate the existing database data (postgres) from the old version onto the new. I tried to follow some online documentation found on the web on how to do this but it doesn’t seem to work. Sonarqube web app says SonarQube Under Maintenance after a successful database data import. Create and restore PostgreSQL backups
On inspection of the database schema backup sql file used between sonarqube versions it seems the schema between them are different and as well as the fields within the table are also slightly different, making database backup and recovery between the sonarqube versions incompatible.
Does SonarQube have an export function of some kind that would allow me to backup existing database data that can later be imported and use on a newer version?


Hi Tam, welcome to the SonarSource Community!

In terms of backup/restore, you’re correct that the upgrade process makes irrevocable changes to the database. I’d suggest you consider your backups of 7.9 to be restorable only for use against 7.9. Obviously take one final backup against your 7.9 data before you upgrade. Then once you migrate to 8.6, you should take a fresh backup and consider it only restore-able for use with 8.6+.

Thanks Jeff, that’s certainly disappointing. Would be nice to have such feature for people who needs to migrate data in upgrades rather than archiving old ones.

I don’t understand the disappointment, which makes me wonder if I misunderstood your initial question? To be clear, you can run 8.6 against a 7.9 database. It will update the existing database schema, however, rendering it incompatible with future use of 7.9 or earlier versions. I’m not sure why you’d want to go backwards.

I think I might have misunderstood your previous response, my apology Jeff. And I think I’ve managed to get it to rebuild the schema and working properly now. Thanks again

1 Like