Move user-managed assets to own subdirectory tree #5161

Closed
opened 2025-12-29 19:24:56 +01:00 by adam · 2 comments
Owner

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

NetBox version

v2.11.10 and v3.0-beta1

Feature type

Change to existing functionality

Proposed functionality

(Moved from #6916)

Currently the /opt/netbox/netbox directory contains a mix of user data/state (media, reports, scripts) and actual Netbox source code (e.g. circuits, dcim, virtualization etc)

I propose that that user files are moved under their own 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

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.

Use case

To make it more straightforward to backup/restore all external (non-database) state, transfer to another Netbox instance, share between frontends via NFS etc.

To allow Netbox to add further state directories in future, without having to change the backup/restore process.

Database changes

None

External dependencies

None

Originally created by @candlerb on GitHub (Aug 9, 2021). ### NetBox version v2.11.10 and v3.0-beta1 ### Feature type Change to existing functionality ### Proposed functionality (Moved from #6916) Currently the `/opt/netbox/netbox` directory contains a mix of user data/state (`media`, `reports`, `scripts`) and actual Netbox source code (e.g. `circuits`, `dcim`, `virtualization` etc) I propose that that user files are moved under their own 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` 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. ### Use case To make it more straightforward to backup/restore all external (non-database) state, transfer to another Netbox instance, share between frontends via NFS etc. To allow Netbox to add further state directories in future, without having to change the backup/restore process. ### Database changes None ### External dependencies None
adam added the type: featurepending closure labels 2025-12-29 19:24:56 +01:00
adam closed this issue 2025-12-29 19:24:56 +01:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 9, 2021):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our contributing guide.

@github-actions[bot] commented on GitHub (Oct 9, 2021): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. NetBox is governed by a small group of core maintainers which means not all opened issues may receive direct feedback. Please see our [contributing guide](https://github.com/netbox-community/netbox/blob/develop/CONTRIBUTING.md).
Author
Owner

@github-actions[bot] commented on GitHub (Nov 8, 2021):

This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.

@github-actions[bot] commented on GitHub (Nov 8, 2021): This issue has been automatically closed due to lack of activity. In an effort to reduce noise, please do not comment any further. Note that the core maintainers may elect to reopen this issue at a later date if deemed necessary.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#5161