Upgrading from v0
v1 is a ground-up rewrite. It is not code-compatible with the v0.x
(NfSen-style) releases, but it reuses the same underlying data: nfsen-ng reads
the nfcapd capture files nfdump already writes, so no data migration is
needed — point v1 at your existing capture tree and run an import.
What changed
Architecture
| v0.x | v1 |
|---|---|
| Apache/nginx + PHP-FPM (per-request) | OpenSwoole via php-via (one persistent process) |
| REST JSON API + AJAX polling | Hypermedia over SSE (Datastar) — no JSON API |
| jQuery frontend | Server-rendered Twig + Datastar signals; no client-side routing or build step |
| RRD only | RRD (default) or VictoriaMetrics |
| No live push | inotify → SSE broadcast to every open tab |
See Architecture → Overview for how the v1 pieces fit together.
Frontend
- jQuery, ion.rangeSlider, and the old REST client are gone.
- Replaced by Datastar, noUiSlider, and Apache ECharts for graphs (v1 migrated the Graphs tab off Dygraphs).
- No client-side routing — the server pushes full HTML re-renders over SSE and Datastar morphs the DOM.
Backend
- The entry point is now
backend/app.php(the OpenSwoole server), not a web server document root. - The
cli.phpinterface was removed. Import is driven from the web UI (Settings → Import → Trigger Import / Force Rescan) by the daemon embedded inapp.php. - Configuration moved to environment variables (
NFSEN_*); thesettings.phpfile still works but is now a deprecated overlay on top of them. If you keep one, start from the currentbackend/settings/settings.php.distrather than reusing a v0 file verbatim (the schema was expanded and reorganised: newgeneral.db,db.<datasource>.*,frontend.defaults.*, and more) — or skip the file entirely and configure via environment variables. See Configuration.
Docker
- v0 ran Apache inside the container; v1 runs the OpenSwoole app and fronts it
with a stock
caddy:latestcontainer (optional, behind theproxyprofile) — there is no custom Caddy image. - Deployment layout moved under
deploy/(docker-compose.yml,docker-compose.dev.yml, …). See Installation. - Persistent data is consolidated under a single
nfsen-datavolume at/var/lib/nfsen-ng(rrd/+state/). If you ran an earlier v1 beta with the separaterrd-datavolume (/var/nfsen-ng/rrd), copy your RRD files into the new volume once — e.g.docker run --rm -v rrd-data:/old -v nfsen-data:/new alpine cp -a /old/. /new/rrd/— or just rebuild them with Force Rescan. See State & persistence. - Unraid template users: the UI template gained a matching App data path
(
/var/lib/nfsen-ng, defaulting to/mnt/user/appdata/nfsen-ng-data) in v1.0.0-beta.3. An install created before that has no such mapping, so add it when you update the container, otherwise the RRD database, preferences, and alert rules are recreated empty on every image update.
Migration steps
-
(Optional) Back up your old RRD files, in case you want to keep the v0 graph history around:
cp -r backend/datasources/data/ /backup/rrd-$(date +%Y%m%d)/ -
Deploy v1. The simplest path is the published Docker image (
ghcr.io/mbolli/nfsen-ng:latest) withdeploy/docker-compose.yml. If you run from source, check out av1.0.0-*release tag (or thev1branch) rather than the old v0 tags. Full steps: Installation. -
Point v1 at your existing capture tree — set
NFSEN_NFDUMP_PROFILES(ornfdump.profiles-data) to the sameprofiles-datadirectorynfcapdalready writes to, and list your sources inNFSEN_SOURCES. -
Review configuration. Map any custom v0 settings onto the current keys or environment variables (Configuration).
-
Build the graph data. Run Settings → Import → Trigger Import (or Force Rescan) once. This rebuilds the RRD/VictoriaMetrics graph data from your
nfcapdfiles — the v1 RRD structure differs from v0’s, so re-importing from the captures is the reliable path rather than reusing old.rrdfiles. Flows and Statistics work directly off the capture files and need no import.