Move user-managed assets to own subdirectory tree #5159

Closed
opened 2025-12-29 19:24:55 +01:00 by adam · 1 comment
Owner

Originally created by @candlerb on GitHub (Aug 8, 2021).

NetBox version

v3.0-beta1

Python version

3.8

Steps to Reproduce

This isn't a bug report, but a suggestion for something that could change for v3.0.

Currently the /opt/netbox/netbox directory contains a mix of user-managed files (media, reports, scripts) and actual Netbox source code. Netbox v3.0 is an opportunity to make a clean separation between them.

There are already configuration settings MEDIA_ROOT, REPORTS_ROOT, SCRIPTS_ROOT so this could just be a case of changing how the defaults are calculated.

Expected Behavior

User-installed data to be in a separate directory tree, perhaps /opt/netbox/data or /var/lib/netbox. In the latter case this would give:

  • /var/lib/netbox/media
  • /var/lib/netbox/reports
  • /var/lib/netbox/scripts

It would then be straightforward to backup/restore /var/lib/netbox, transfer to another Netbox instance etc.

Observed Behavior

By default, the user-managed assets are in:

  • /opt/netbox/netbox/media
  • /opt/netbox/netbox/reports
  • /opt/netbox/netbox/scripts

alongside code directories such as

  • /opt/netbox/netbox/circuits
  • /opt/netbox/netbox/dcim
  • ... etc
Originally created by @candlerb on GitHub (Aug 8, 2021). ### NetBox version v3.0-beta1 ### Python version 3.8 ### Steps to Reproduce This isn't a bug report, but a suggestion for something that could change for v3.0. Currently the `/opt/netbox/netbox` directory contains a mix of user-managed files (media, reports, scripts) and actual Netbox source code. Netbox v3.0 is an opportunity to make a clean separation between them. There are already configuration settings `MEDIA_ROOT`, `REPORTS_ROOT`, `SCRIPTS_ROOT` so this could just be a case of changing how the defaults are calculated. ### Expected Behavior User-installed data to be in a separate directory tree, perhaps `/opt/netbox/data` or `/var/lib/netbox`. In the latter case this would give: * `/var/lib/netbox/media` * `/var/lib/netbox/reports` * `/var/lib/netbox/scripts` It would then be straightforward to backup/restore `/var/lib/netbox`, transfer to another Netbox instance etc. ### Observed Behavior By default, the user-managed assets are in: * `/opt/netbox/netbox/media` * `/opt/netbox/netbox/reports` * `/opt/netbox/netbox/scripts` alongside code directories such as * `/opt/netbox/netbox/circuits` * `/opt/netbox/netbox/dcim` * ... etc
adam added the type: bugstatus: revisions needed labels 2025-12-29 19:24:55 +01:00
adam closed this issue 2025-12-29 19:24:55 +01:00
Author
Owner

@jeremystretch commented on GitHub (Aug 9, 2021):

Could you resubmit this as a feature request, please, since it does not describe unexpected behavior? I'm also not clear on the use case.

something that could change for v3.0.

I'm afraid it's too late in the release cycle to introduce any substantial changes. It would need to be discussed for v3.1.

@jeremystretch commented on GitHub (Aug 9, 2021): Could you resubmit this as a feature request, please, since it does not describe unexpected behavior? I'm also not clear on the use case. > something that could change for v3.0. I'm afraid it's too late in the release cycle to introduce any substantial changes. It would need to be discussed for v3.1.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5159