Automatically Archive Old NetBox Branches

Automatically Archive Old NetBox Branches

A common question we get from students using NetBox Branching is:

How can I automatically remove stale branches from NetBox?

Therefore, I thought I’d share the latest addition to NetBox Branching, introduced in v1.1.2.

This release adds the auto_archive_days setting, allowing you to automatically archive merged branches after a specified number of days.

# configuration.py
PLUGINS_CONFIG = {
    'netbox_branching': {
        'auto_archive_days': 30,
    }
}

A few things to note:

  • A daily background job archives merged branches older than the specified number of days, helping reduce database bloat.
  • Automatic archival is disabled by default.
  • Once a branch has been archived, it can no longer be reverted.

Subscribe to our newsletter and stay updated.

Don't miss anything. Get all the latest posts delivered straight to your inbox.
Great! Check your inbox and click the link to confirm your subscription.
Error! Please enter a valid email address!