Sonarqube upgrade from 6.7.7 LTS to 7.9 LTS, ERROR: relation "live_measures" already exists

**Database (PostgreSQL) migration failed with
‘Create table live_measures’ failed, caused by

ERROR: relation "live_measures" already exists

when updating SonarQube from 6.7.7 LTS to 7.9 LTS**

2019.07.12 07:25:41 INFO  web[][o.s.s.p.d.m.DatabaseMigrationImpl] Starting DB Migration and container restart
2019.07.12 07:25:41 INFO  web[][DbMigrations] Executing DB migrations...
2019.07.12 07:25:41 INFO  web[][DbMigrations] #1930 'Add QUALITY_GATES.IS_BUILT_IN'...
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1930 'Add QUALITY_GATES.IS_BUILT_IN': success | time=177ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1931 'Populate QUALITY_GATES.IS_BUILT_IN'...
2019.07.12 07:25:42 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 3 quality_gates processed (0 items/sec)
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1931 'Populate QUALITY_GATES.IS_BUILT_IN': success | time=64ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1932 'Make QUALITY_GATES.IS_BUILT_IN not null'...
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1932 'Make QUALITY_GATES.IS_BUILT_IN not null': success | time=62ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1933 'Remove quality gates loaded templates'...
2019.07.12 07:25:42 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 1 delete loaded templates for quality gate processed (0 items/sec)
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1933 'Remove quality gates loaded templates': success | time=16ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1934 'Rename quality gate "SonarQube way" to "Sonar way"'...
2019.07.12 07:25:42 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 1 quality gates processed (0 items/sec)
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1934 'Rename quality gate "SonarQube way" to "Sonar way"': success | time=9ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1935 'Drop LOADED_TEMPLATES table'...
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1935 'Drop LOADED_TEMPLATES table': success | time=133ms
2019.07.12 07:25:42 INFO  web[][DbMigrations] #1936 'Delete person measures'...
2019.07.12 07:26:26 INFO  web[][o.s.s.p.d.m.s.MassUpdate] 66219 snapshots processed (1103 items/sec)
2019.07.12 07:26:26 INFO  web[][DbMigrations] #1936 'Delete person measures': success | time=44397ms
2019.07.12 07:26:26 INFO  web[][DbMigrations] #1937 'Drop index on project_measures.person_id'...
2019.07.12 07:26:26 INFO  web[][DbMigrations] #1937 'Drop index on project_measures.person_id': success | time=22ms
2019.07.12 07:26:26 INFO  web[][DbMigrations] #1938 'Create table live_measures'...
2019.07.12 07:26:26 ERROR web[][DbMigrations] #1938 'Create table live_measures': failure | time=27ms
2019.07.12 07:26:26 ERROR web[][DbMigrations] Executed DB migrations: failure | time=44914ms
2019.07.12 07:26:26 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=45028ms
2019.07.12 07:26:26 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 #1938 'Create table live_measures' failed
        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:79)
        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:67)
        at java.base/java.lang.Iterable.forEach(Iterable.java:75)
        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:52)
        at org.sonar.server.platform.db.migration.engine.MigrationEngineImpl.execute(MigrationEngineImpl.java:68)
        at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doUpgradeDb(DatabaseMigrationImpl.java:105)
        at org.sonar.server.platform.db.migration.DatabaseMigrationImpl.doDatabaseMigration(DatabaseMigrationImpl.java:80)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalStateException: Fail to execute CREATE TABLE live_measures (uuid VARCHAR (40) NOT NULL,project_uuid VARCHAR (50) NOT NULL,component_uuid VARCHAR (50) NOT NULL,metric_id INTEGER NOT NULL,value NUMERIC (38,20) NULL,text_value VARCHAR (4000) NULL,variation NUMERIC (38,20) NULL,measure_data BYTEA NULL,update_marker VARCHAR (40) NULL,created_at BIGINT NOT NULL,updated_at BIGINT NOT NULL, CONSTRAINT pk_live_measures PRIMARY KEY (uuid))
        at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:97)
        at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:77)
        at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:117)
        at org.sonar.server.platform.db.migration.version.v70.CreateTableLiveMeasures.execute(CreateTableLiveMeasures.java:53)
        at org.sonar.server.platform.db.migration.step.DdlChange.execute(DdlChange.java:45)
        at org.sonar.server.platform.db.migration.step.MigrationStepsExecutorImpl.execute(MigrationStepsExecutorImpl.java:75)
        ... 9 common frames omitted
Caused by: org.postgresql.util.PSQLException: ERROR: relation "live_measures" already exists
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
        at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
        at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:266)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
        at org.apache.commons.dbcp2.DelegatingStatement.execute(DelegatingStatement.java:175)
        at org.sonar.server.platform.db.migration.step.DdlChange$Context.execute(DdlChange.java:82)

Greetings @harryscheibling,
The live_measures table has been introduced in the 7.0 version of SonarQube, meaning that your database may have been corrupted by a previous non successful upgrade.
Can you confirm ?
If you have a backup of the initial database you should reload it and restart your upgrade on this image.
Alex.

@Alexandre_Frigout , thank’s so much. That pointed me to the right direction. After

DROP TABLE "live_measures";
ALTER TABLE organization_alm_bindings DROP COLUMN members_sync_enabled;
ALTER TABLE webhooks DROP COLUMN secret;

the migration finished successful.

Thank you