Preserve image-attachments directory on upgrade #1096

Closed
opened 2025-12-29 16:28:49 +01:00 by adam · 5 comments
Owner

Originally created by @LBegnaud on GitHub (Jul 12, 2017).

Feature Request:

I couldn't find it anywhere obvious, but during the upgrade process it is necessary to move the image-attachments directory contents to the new path. Also (at least for my installation) i have to chown to the netbox user on that folder.

I'm curious if we could get the process bundled into the upgrade.sh (maybe just move the contents from the old netbox symlink?). I'd be happy with a config option to point the image-attachments directory somewhere else on the filesystem if not.

Originally created by @LBegnaud on GitHub (Jul 12, 2017). **Feature Request**: I couldn't find it anywhere obvious, but during the upgrade process it is necessary to move the image-attachments directory contents to the new path. Also (at least for my installation) i have to chown to the netbox user on that folder. I'm curious if we could get the process bundled into the upgrade.sh (maybe just move the contents from the old netbox symlink?). I'd be happy with a config option to point the image-attachments directory somewhere else on the filesystem if not.
adam added the type: feature label 2025-12-29 16:28:49 +01:00
adam closed this issue 2025-12-29 16:28:49 +01:00
Author
Owner

@jeremystretch commented on GitHub (Jul 18, 2017):

This might get murky when dealing with symlinks (e.g. media/ -> /opt/somewhere/else/). Not really sure how best to approach this. Any ideas?

@jeremystretch commented on GitHub (Jul 18, 2017): This might get murky when dealing with symlinks (e.g. `media/ -> /opt/somewhere/else/`). Not really sure how best to approach this. Any ideas?
Author
Owner

@LBegnaud commented on GitHub (Jul 18, 2017):

I agree symlinks underneath the the /opt/netbox symlink would get hairy, but that seems like the simplest option

Looks like media/ is served by django directly, could we not just have a config option to point that elsewhere?

@LBegnaud commented on GitHub (Jul 18, 2017): I agree symlinks underneath the the /opt/netbox symlink would get hairy, but that seems like the simplest option Looks like media/ is served by django directly, could we not just have a config option to point that elsewhere?
Author
Owner

@jeremystretch commented on GitHub (Jul 18, 2017):

Yeah, I think exposing it as a config option makes sense.

@jeremystretch commented on GitHub (Jul 18, 2017): Yeah, I think exposing it as a config option makes sense.
Author
Owner

@Zorlin commented on GitHub (Jul 19, 2017):

+1 for making it a config option. That seems the least insane way to handle this ;)

@Zorlin commented on GitHub (Jul 19, 2017): +1 for making it a config option. That seems the least insane way to handle this ;)
Author
Owner

@lae commented on GitHub (Aug 28, 2017):

There's a config option for this already, MEDIA_ROOT - for handling upgrades I'm actually modifying settings.py but preferably this would be configured within configuration.py.

@lae commented on GitHub (Aug 28, 2017): There's a config option for this already, `MEDIA_ROOT` - for handling upgrades I'm actually [modifying `settings.py`](https://github.com/lae/ansible-role-netbox/commit/78c9d0eab58916c0556aebc0bf3f0fe997f7c16d) but preferably this would be configured within `configuration.py`.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1096