Cleanup of analysed snapshots of projects

Would like to cleanup or sonar server, we have pretty many snapshots like:

How can we automagic delete all except the latest one ?


Hi Anders,

I don’t recognize what part of the interface that’s a screenshot of. I bring it up because you don’t give us a lot to go on. Are you truly talking about snapshots/analyses of the master branch or is this something to do with branches? If we are talking about analyses of master I’d say the problem is that your project version changes quite frequently. Each time the version string changes, a version event is set on the analysis, and analyses with events aren’t subject to housekeeping. You’ll need to clean up analyses with events manually.

BTW, it looks like you may be using semantic versioning (hard to tell given the crop on your screenshot). If so, you may be interested in the work we’re just starting on MMF-1524.


Ok, this is from the Projects management,
It’s same project but different snapshot of it or different Feature branches.
Do we have to delete them manually ?
Hm, what is semantic versioning ?
Thanks! Will look into MMF-1524


Yes, you have to delete projects manually.


Ok, ,thank you.
Then i now.
Would that be different if we used developer version of sonarqube and branches plugin ?



SonarQube is never going to delete projects for you. Nor will it delete long-lived branches. It does clean up short-lived branches and PRs.


When is a branch a long-lived branch, and when is it considered not?

Hi @michahell,

Welcome to the community!

By now they’re all considered long-lived. We got rid of the long-short distinction in… the 8-series, IIRC.


Hello G Ann!

How should users of SonarQube make sure that branches are removed? Is there really not a better way to do this then to manually remove them? How about some sort of inactivity mechanism that is configurable?

Hi @michahell ,

Take a look into Administration > Configuration > General Settings > Housekeeping. You can define retention periods in days there, after which stale branches will be cleaned up.

More info:

1 Like