When to perform the dB cleanup activity after SonarQube upgrade?

Version being used: SonarQube 8.9.9 Community Edition
SonarQube deployed: ZIP installation
Trying achieve: Upgrade SonarQube Community Edition 8.9.9 to Community Edition 10.3.
Tried so far: Noted down all property changes in the sonar.properties.

Questions:

  1. As per the document, it says below.

To upgrade from the ZIP file:

Stop your old SonarQube Server
Start your new SonarQube Server
Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions
Reanalyze your projects to get fresh data.

PostgreSQL clean-up
Once you’ve finished a technical upgrade, you should rebuild database indexes and refresh database statistics before starting SonarQube and reanalyzing your projects.

For PostgreSQL, that means executing three operations:

VACUUM FULL
REINDEX DATABASE
ANALYZE

My question is when should you perform the PostGreSQL Clean up? As per the document, it says you need to stop the services, start new SonarQube services, browse to http://yourSonarQubeServerURL/setup and follow the setup instructions.

But under the PostgreSQL clean-up, it says you need to perform the dB tasks before you start SonarQube. So which one should be followed?

Hi and welcome to the community!

You have to run PostgreSQL clean-up “once you’ve finished a technical upgrade”.

The technical upgrade means:

  • Stop your old SonarQube Server
  • Start your new SonarQube Server
  • Browse to http://yourSonarQubeServerURL/setup and follow the setup instructions
  • Reanalyze your projects to get fresh data.

The database clean-up means:

  • Stop your SonarQube instance to perform database clean-up
  • Run VACUUM FULL, REINDEX DATABASE and ANALYZE.
  • Start your SonarQube instance.

You should do the database clean-up frequently and keep you database as optimized as possible. Ask your DBAs to do that or do it by yourself.

Best regards.

Thank you, Antonio!

if there is a place in the official docs for database-stuff with postgres … i’d love to see this answer worked in there somehow

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.