Goal
Drastic changes to Retention Policy settings can cause the task to fail/timeout. This process explains slowly tightening the values to ensure this does not happen.
Prerequisites
RetentionAdminister permission is required for the user attempting to make this change.
Steps
-
Choose where to change the policy:
-
Space default: go to Deploy > Manage > Retention, then Release Retention or Runbook Retention. This applies to lifecycles and runbooks that use the default. Octopus 2025.4 and later. The page is behind a feature toggle, so contact support if you don't see it.
- One lifecycle: open the lifecycle and change its release retention policy.
-
One runbook: open Project > Runbooks > [runbook] > Settings > Retention Policy.
-
Take note of the current value. E.G 500 Releases.
-
Lower this value and select save. A drastic change may cause the task to fail. We have chosen 400 in this example.
-
Either wait for the Apply Retention Policy task to run automatically, or manually start this task.
-
To manually start the task, navigate to Tasks, ensure Include System Tasks is selected, and filter by task type Apply Retention Policies.
-
Select the top task from the list.
-
Navigate to the overflow menu on this page, and select Re-Run.
-
Once the task succeeds, check its log for the deleted counts, then repeat these steps with a lower value. Don't lower the value again while an Apply Retention Policies task is still running.
Verify
The Apply Retention Policies task log has no errors. A successful task can delete zero releases if you haven't yet exceeded the new value. Check the deleted counts in the log to confirm the task is removing items as expected.