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. - Settings still live in a PHP file that assigns the global
$nfsen_configarray, but the schema was expanded and reorganised (newgeneral.db,db.<datasource>.*,frontend.defaults.*, and more). Start from the currentbackend/settings/settings.php.distrather than reusing a v0 file verbatim — 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.
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.