Cleaning of Octopus DB

Hello- We are having intermittent failures from octopus lately which we use through our jenkins pipelines.
We deploy our software through tentacles and use octo.exe to deploy. Lately octopus is timing out as jenkins is not able to check the status of deployment resulting in our pipeline failures. We share our octopus with other teams and looking at DB it seems variableset and event table are more than 100 GB each . We create releases every night in octopus and deploy software on around 50 env’s .Is it possible to get some help on how to clean this DB without affecting anything . Does octopus supply any clean up script or are there any guidelines regarding that. We want to clean out the old deployment , releases etc which i am sure gets accumulated over time . Any help would be appreciated.

Hi @naeron,

Thanks for getting in touch!

The first step here would be to take a look at how your retention policies are configured. Setting these up for each project would allow old releases to be automatically cleaned up, which should also remove any linked variable snapshots.

As for the Event table, currently, no cleanup is performed on this table so to reduce the size you would need to interact with it directly and remove any old entries that are no longer useful. It is safe to do this without affecting Octopus in any way, but please ensure to take a backup of the database beforehand.

Best regards,

1 Like

Hi Paul,

Thanks a lot for your reply. We are using very old version of octopus and it has not been upgraded for years for so i am being told. Do you know if retention policy feature has been there in octopus from get go so that it will be available in old version also or is this something which octopus just introduced in newer version.

Regards
Narender

Hi Narender,

Retention policies has been a feature available since version 3.x of Octopus.

Also, I just noticed that the link to the retention policies section I added above was incorrect, so have fixed that.

Regards,
Paul

Thanks a lot paul. We will try these steps and see if it helps.

Regards
Narender

1 Like