The two records are the same; however, when looking at the created_at/updated_at fields, there is one from January 20 (which makes sense) and one from December 6.
This is probably the date you made the first attempt to upgrade, and I suspect the way you are restoring the backup is not removing the newly created measures table.
Can you try again, but make sure to truncate or drop the measures table before starting the upgrade?
Iâm not an expert on that, but I believe you would have to drop the entire db before restoring. The --clean option will only drop and re-create the tables (or other objects) that are part of the dump. So in this case it didnât touch the measures table which doesnât exist in the dump.
Hello @HaNs_Neefs, @haugsrud and @AngelaMarie,
We are trying to identify why the migration is failing with an out of memory error. Are you using the community plugin dependency-check or any other custom plugin? Thanks.
2025.09.25 11:43:32 ERROR web[o.s.s.p.d.m.DatabaseMigrationImpl] DB migration ended with an exception
org.sonar.server.platform.db.migration.step.MigrationStepExecutionException: Execution of migration step #108003 âMigrate the content of âlive_measuresâ to âmeasuresâ for branchesâ failed
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:112)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:97)
at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:70)
at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:55)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:106)
at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:81)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.sql.BatchUpdateException: ORA-00001: unique constraint (SONARQUBE.PK_MEASURES) violated
After the failure, I run the following script:
SELECT SUM(count) as total_duplicates FROM ( SELECT component_uuid, COUNT() as count FROM measures GROUP BY component_uuid HAVING COUNT() > 1 ) duplicates
And get these results:
Total Duplicates:
1 (null)
So, it looks like it is trying to put two null values in my table.
Any thoughts on what I can check or do? And is there anyway to fix and restart or do I need to reload the backup of the DB Schema?
Hello @mattgoodnight,
I suppose the migration failed a first time and was relaunched a second time, leading to this issue.
The easiest solution is to restore your backup and relaunch.
Iâve restored and retried 3 times. Really looking for a better solution, as that doesnât work. Is there anyway to fix the DB and then continue with the migration?
Are you sure the measures table is dropped when you restore the backup? Depending on your restoration method, the table may not be removed since itâs a new one.
Please make sure the table doesnât exist or is empty before restarting the upgrade.