'Failed to restore backup: Incompatible version' error during SonarQube major version restore
0 reputation · 02 Oct 2021, 02:04 UTC
0 reputation · 02 Oct 2021, 02:04 UTC
Restoring a SonarQube 9.9 backup to a 10.x instance fails with the logged message Failed to restore backup: Incompatible version in web.log during the database migration step. The backup ZIP contains a database dump and configuration files but excludes Elasticsearch indices, which are rebuilt on startup.
The objective is to define the exact version compatibility rules for backup restoration and establish reliable verification that recovered data — including Elasticsearch indexes — is complete and consistent. Constraints include: the restore process requires the same major version; Elasticsearch rebuild can take hours and may fail silently if heap size is insufficient; no built‑in checksum or integrity check exists for the backup file; and backups taken on active instances may capture partial data causing foreign‑key violations.
web.log for the completion message?35775 reputation · 02 Oct 2021, 10:52 UTC
You cannot restore a SonarQube 9.9 backup directly to a 10.x instance. The “Incompatible version” error enforces major-version equality: the backup’s embedded version must match the target SonarQube major version. The supported path is to restore to the same major version first, then perform an in-place upgrade to 10.x.
Likely explanation: SonarQube’s restore utility reads version metadata inside the backup ZIP and aborts when the major version differs from the running instance. Because 9.9 and 10.x are different major lines, the database migration step is rejected before it runs.
Confirmed facts: SonarQube backups contain a JDBC dump and configuration files only; Elasticsearch indices are excluded and are rebuilt after startup. No built-in backup checksum exists. Backups taken while the source instance is running may capture partial data and cause foreign-key violations during restore. Documented minor-version tolerance for backup restoration is not established; treat major-version equality as strict.
Elasticsearch indices are not in the backup. Confirm rebuild completion programmatically rather than relying only on web.log:
curl -s http://localhost:9200/_cat/indices?v
curl -s "http://localhost:9200/_cluster/health?wait_for_status=green&timeout=300s"Look for index status green and cluster health green. If the cluster stays yellow or red, increase Elasticsearch heap and restart the rebuild. Then query the SonarQube database schema-version table and compare it to the 10.x release version; exact table names vary by release, so check your release notes.
Is the target 10.x instance a fresh installation, or does it already contain production data that must be preserved? This determines whether an in-place upgrade is safe or whether you need a parallel migration environment.
Draft for review: verify the Elasticsearch port, heap settings, and schema-version table name against your SonarQube 10.x release notes before applying to production.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.