Required steps for reindexing the projects in sonarqube migration to get Portfolios

[Steps required to reindex the projects for Portfolio summary in sonarqube post migration ]

  • Migration Path
    From 6.5 > 6.7.7 LTS > 7.9.4 LTS > 8.0
  • Database used source path as mysql and target path as postgresql
  • Portfolio won’t available for projects post migration from sonarqube 6.5 to 8.0 - Need solution to address portfolio issue as part of migration
  • Have done migration to new version of sonarqube 8.0 so far. Detail steps which i followed given below.
    1.Download and unzip the SonarQube versions in a fresh directory as per migration path given above , let’s say $NEW_SONARQUBE_HOME
    2.Used plugins that are compatible with version of SonarQube.
    3.Update the contents of sonar.properties and wrapper.conf files (in $NEW_SONARQUBE_HOME/conf) with the settings of the related files in the $OLD_SONARQUBE_HOME/conf directory (web server URL, database, ldap settings, etc.).
    4.Stop old SonarQube Server
    5.Start new SonarQube Server by deleting data & tmp folder
    6.Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions
    7.Reanalyze your projects to get fresh data

Hi,

To be clear,

  • You have a valid Enterprise Edition license?
  • You migrated from MySQL to another database engine as part of this upgrade?
  • You’ve re-analyzed all your projects?
  • You’re just trying to figure out what button to push to get your portfolios updated after all the above steps?

 
Ann

[Portfolio is not available for projects post migration/upgrade to new sonarqube version]

  • Migration Path
    From 6.5 > 6.7.7 LTS > 7.9.4 LTS > 8.0
  • Database used source path as mysql and target path as postgresql
  • Portfolio won’t available for projects post migration from sonarqube 6.5 to 8.0 - Need solution to address portfolio issue as part of migration and provide detailed steps to fix this. Please note i have tried reindexing the ES but could not achieve.
  • Have done migration to new version of sonarqube 8.0 so far. Detail steps which i followed given below.
    1.Download and unzip the SonarQube versions in a fresh directory as per migration path given above , let’s say $NEW_SONARQUBE_HOME
    2.Used plugins that are compatible with version of SonarQube.
    3.Update the contents of sonar.properties and wrapper.conf files (in $NEW_SONARQUBE_HOME/conf) with the settings of the related files in the $OLD_SONARQUBE_HOME/conf directory (web server URL, database, ldap settings, etc.).
    4.Stop old SonarQube Server
    5.Start new SonarQube Server by deleting data & tmp folder
    6.Browse to http://SonarQubeServerURL/setup and follow the setup instructions
    7.Reanalyze your projects to get fresh data

Hi again and welcome to the community!

You seem to have created 2 threads on the same topic, so I’ve combined them here. Please do still clarify the questions from my previous response.

 
Ann

Please find my comments for above questions
No Enterprise Edition used. We are using Community Edition.
As part of upgrade, we migrated from MYSQL to Postgresql 10.x .
We have re-analyzed the projects at Database but portfolio summary is not available for migrated projects only.
Yes, I am expecting steps to get portfolios for projects post migration with community Edition

Please provide detail steps to address this issue.

Hi,

Community Edition doesn’t offer portfolios, so I’m not sure what it is that’s not working for you. In case you’re talking about the Projects page, then it could be a corrupted Elasticsearch index. For that, you should try:

  • shut the server down
  • delete $SONARQUBE-HOME/data/es6
  • restart the server

If it’s something else, then it’s likely provided by a 3rd-party plugin & you should contact the maintainers of that plugin.

 
:woman_shrugging:
Ann

I have already done the steps given above and still getting projects portfolio error as “The main branch of this project is empty” post migration from SQ 6.5 to 8.0.

Followed below steps post migration from 6.7.7 LTS to 7.9.4 LTS, 7.9.4 LTS to 8.0 with community Edition.

1). shutdown the sonarqube server post migration
2). deleted $SONARQUBE-HOME/data/es6 & $SONARQUBE-HOME/tmp/
3).restarted the sonarqube server

PFA for your reference and Please note that this issue is exists during the migration from 6.7.7 LTS to 7.9.4 LTS and 7.9.4 LTS to 8.0.

Could you please give solution to address this issue during migration

Hi,

Please post the code-formatted (``` on the line before and on the line after) text of your analysis logs.

 
Ann

the code-formatted ( ````` on the line before and on the line after) - What you are expecting from me i am not sure.

PFA logs from sonarqube during upgrade

es.log (7.6 KB) web.log (49.2 KB) sonar.log (3.3 KB) access.log (48.2 KB) ce.log (1.6 KB)

Hi,

Those are the server logs. What I’m looking for is what’s printed out after you execute the analysis command.

 
Ann

I have not executed any analysis command post upgrade as I am new to sonarqube upgrade.

You are looking below scan command & code used in sonar-project.properties

$HOME/sonar-scanner-4.1.0.1829-windows/bin/sonar-scanner.bat

sonar.projectKey=Test _Test
sonar.projectName=Test _Test
sonar.projectVersion=1.0
sonar.sources=D:/Source/
sonar.java.binaries=D:/Source/

Followed below steps for upgrade.
1.Download sonarqube and unzip the SonarQube versions in a fresh directory as per migration path given in above topics.
2.Used plugins that are compatible with version of SonarQube.
3.Update the contents of sonar.properties with MySQL
4.Stop SonarQube Server
5.Start SonarQube Server by deleting data & tmp folder
6.Browse to http://hostname:port/setup and click on Upgrade
7.Post Upgrade sonarqube server started and then login with credentials then screen appear as below.

Any update on above request ?

Hi,

If you haven’t executed an analysis then what you’re seeing is perfectly normal.

However, the fact that you provided this indicates that you have run analysis at some point:

What I’m looking for is the text that’s printed to the console after you enter your sonar-scanner.bat command.

 
Ann

The reported issue has been fixed by running the scan with sonar ant build.xml file instead of sonar scanner.