Sonarqube Upgrade - 6.7.4 (build 38452) - [LGPL v3] to 8.5.1

Currently we are using (SonarQube - Version 6.7.4 (build 38452) - [LGPL v3] , We are planning to upgrade to latest community version , which is 8.5.1. Can some one guide me how to do this Upgrade.

Hi @rmaryada! Welcome to the SonarSource Community!

In your case, your upgrade path is like so: 6.7.4 LTS -> 7.9 LTS -> 8.5.1

This means you will need to upgrade to 7.9 LTS then you will be able to upgrade to 8.5.1.

  1. Please first read our instructions on Upgrade the Server and the Release Upgrade Notes. The latter will be very important when you upgrade between versions, so please familiarize yourself and read these notes to avoid any surprise regressions, deprecation notices, and more.
  2. Read through the Upgrade Guide and follow the instructions. You will need to backup your database, any custom plugins (8.5.1 now includes the core plugins already, see here for more), and the sonar.properties file, just in case.

If you have any more questions, create a new thread and we can help you there.

Joe

Thanks Joe …

I see we have a process running with PostgressSQL does that mean , we are using Postgress Database.

  1. How do we copy the data from database from current version to latest version

Hi @rmaryada,

You do not need to copy data from your database, you can keep the same one. The version of SonarQube changes, not your database. Since you are using PostgreSQL, make sure to execute vacuum full:

Additional Database Maintenance

Refreshing your database’s statistics and rebuilding your database’s indices are recommended once the technical upgrade is done (just before the very last step).

For PostgreSQL, that means executing VACUUM FULL . According to the PostgreSQL documentation:

In normal PostgreSQL operation, tuples that are deleted or obsoleted by an update are not physically removed from their table; they remain present until a VACUUM is done.

Source here: Additional Information

Please review the links I’ve sent you as they have a lot of information that will help make your upgrade a smooth process. There are many things to check so review carefully.

Joe

Thanks Joe …

Postgres Version : 9.6
SQ Version : 7.9.4

After Upgrading from 6.7.4 to 7.9.4 , when trying to set up in the browser ( http://yourSonarQubeServerURL/setup ) , I got below error , I am not sure where to look and proceed on this , I am relatively very new to sonarqube tool

2020.11.09 09:56:04 ERROR web[][DbMigrations] #1942 'Add live_measures.metric_id index': failure | time=23ms
2020.11.09 09:56:04 ERROR web[][DbMigrations] Executed DB migrations: failure | time=1447ms
2020.11.09 09:56:04 ERROR web[][o.s.s.p.d.m.DatabaseMigrationImpl] DB migration failed | time=1506ms
2020.11.09 09:56:04 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 #1942 'Add live_measures.metric_id index' 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 UNIQUE INDEX live_measures_component ON live_measures (component_uuid, metric_id)
        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.AddLiveMeasuresMetricIndex.execute(AddLiveMeasuresMetricIndex.java:44)
        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: could not create unique index "live_measures_component"
  Detail: Key (component_uuid, metric_id)=(6174d71b-09c9-415e-bf4e-a19edcc1a094, 145) is duplicated.
        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)
        ... 14 common frames omitted

Joe , Can you please help , This is a show stopper for us.

Hi @rmaryada,

Apologies for the delay. What is your current status now?

  1. Please post your logs including the error.
  2. If you ran SQL queries, please show what you ran and the results of the query.
  3. What have you tried so far?
  4. What was the result of SONAR-12282 SQL query? Did you remove the projects?

Joe