upgrade sonar and import all existing project matrix - sonarqube

we would like to upgrade from Sonar 3.0 to 3.5. we have many project profiles/matrix in the current sonar and if possible to import existing project matrix, build data and time machine data into the new sonar. How do i export current data and make them visible in Sonar 3.5?
Tried to upgrade in my testing machine and turned out Sonar page is empty. I followed all the Sonar upgrade guide including backup. It is important for us to keep existing project build and trending matrix(time machien).
btw, i'm using mysql.

When using Sonar with DBs like Oracle, MySql, Postgres or MSSQL, the migration process keeps everything already in place and you should end up with the same state as it was before the migration. If this is not the case, this means that the migration went wrong and you should be able to see it in the logs.

Related

How to upgrade sonar from 5.6 to 6.7 with dedicated database

I am using 5.6 version of sonar, want to upgrade to 6.7. Can I directly upgraded to 6.7 ?
I have 8-10 sonar projects hosted on a same instance of sonar server. I am not sure what would break after upgrade. I am thinking of following approach
Install (do not upgrade) a new version of sonar 6.7, this would run on the different port(s).
Create a copy of sonar database which I have with my older sonar version, attach that copy of DB to new installation of sonar (by updating the sonar configuration file).
Assuming everything works fine, retire the older version (sonar server & DB).
I am using dedicated database as SQL server.
Anybody tried this approach? does it work?
Atul
If you're using one of the supported databases, you can upgrade directly from 5.6 to 6.7.
Simply follow the Upgrade Guide - and make sure that you back up your DB first in case of troubles.

Upgrade from SonarQube 5.6 to 5.6.6 database migration fails to show summary numbers correctly

SonarQube Community,
I upgraded from SonarQube 5.6 to 5.6.6 and the DB migration appeared to complete successfully.
Afterwards some of the projects summary data when drilling into the project does not show correctly while other projects do.
I have provide a link to the 3 items, two pngs showing visually what I am trying to communicate and the third with the log output from the upgrade and data migration.
I have rolled back to the old DB data as well as 5.6 and done this upgrade twice with the same outcome so it can be reproduced.
Is there something I need to know in doing this upgrade that I may have missed?
I have done several upgrades over the years and this is the first time I have seen this problem.
Thanks for any help you may be able to provide.
Doug
This is a case of a corrupted ElasticSearch index. It can be fixed by deleting _$SONARQUBE_HOME/data/es_.
From your comments, it looks like you carried over the ES index from your previous version. Instead, you should have
turned off your old version
exploded the zip for the new version
pointed the new version at your database
(re)installed your plugins
started the new version and allowed the ES indices to automatically (re)generate as part of the upgrade process

SonarQube does not save project (historical) data

Both SonarQube 5.4 and 6.1 fail to save project (historical) data for the same 12 of my 64 projects. At first I thought it was related to a version and database upgrade (search SO for “SonarQube 6.1 not calculating lines of code after upgrade and database migration”), but I have both wiped the database, reinstalled SQ, and deleted and recreated the projects from within SQ multiple times to no effect.
As you can see in this screenshot:
SQ does recognize and analyze the files, but doesn't save anything to the database. I ran a project with SQ with logging set to TRACE and the results are here.
For anyone who looks at the log and wonders why I am running SQ 5.4, it is because that is apparently the newest version that supports analyzing C# files on non-Windows systems.
Thanks in advance for any help you can provide.

Sonar in Maven build stopped working

I had a project built with maven on a Jenkins CI server, and recently the Sonar portion of the build began to fail with the well known
org.sonar.core.persistence.BadDatabaseVersion: Database must be upgraded. Please browse http://x.x.x.x:9000/setup
I browsed to http://x.x.x.x:9000/setup, and the message there was green and said my database was up to date. The database looks good and the sonar server doesn't throw any Exceptions as far as I can tell from the output, and this installation had been working well up until a few days ago.
I checked that the id was the same between the running server and the database, and insured that only one instance of Sonar was talking to the H2 DB.
My next step is to step through Sonar code, which I'm not eager to do. Any pointers as to what's wrong would be appreciated.
Thanks.
Your Maven plugin version is probably not aligned with your Sonar install.

Import project into Sonar

Is there anyway to migrate individual projects and merge them into an existing instance of Sonar?
Background:
I've setup a new instance of Sonar by performing a normal backup and restore. Another team, also using Sonar, want to migrate their projects over to this new server as well. I'm now faced with a data merging problem.
This is currently not possible. The best way to achieve this is to replay the project history by running Sonar analyses with the "-Dsonar.projectDate=xxxx-xx-xx" property.
For more information, take a look a the "sonar.projectDate" description on the "Analysis Parameters" documentation page.

Resources