Back up plugin files referenced by model FileFields

- Scan all Django models (incl. plugins) for FileFields via manage.py
  shell, like the NetBox-Export plugin, and use the real MEDIA_ROOT
- Store files outside MEDIA_ROOT under extra_files/ and restore them to
  their original path (mapped onto the current installation)
- Warn about missing files and files in external storages
- Bump backup format to 1.4, document in READMEs

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
MrBlakeandClaude Opus 5.5 committed 2026-11-13 13:47:31 +01:00
1 parent c6dcb9567c
commit 0f054ef109
3 files changed
+144 -14

No files matched your search

+1 -1
View File
@@ -238,7 +238,7 @@ Main menu → `1. Backup erstellen`.
The tool asks which components to back up:
1. **PostgreSQL database** (`pg_dump -Fc`)
2. **Media files** (`netbox/media/`)
2. **Media files** (`MEDIA_ROOT`, default `netbox/media/`). The tool also asks NetBox (via `manage.py shell` in the venv) for every file referenced by a model `FileField` – including plugins, same approach as [NetBox-Export](https://git.mrblake.cc/MrBlake/NetBox-Export). Files outside `MEDIA_ROOT` are stored under `extra_files/` and written back to their original path on restore. Missing files and files in external storages (e.g. S3) are reported as warnings.
3. **Installation files** – a complete copy of the NetBox installation directory
The installation files contain everything in the (resolved) `netbox_path`, for example: