Take a backup first
A newer DNZ upgrades the database when it starts, and an older version may refuse it afterwards. Take a backup before every upgrade, so you can go back.- DNZ's own backups
- SQLite (binary)
- SQLite (Docker)
- Postgres or MySQL
With a target set up under Settings → Backups, run every target now and wait for the result:An archive restores onto the version that made it or a newer one; see
Backups and restore. This works on every database, Redis included.
Upgrade
- Docker Compose
- Install script
- Binary
In the folder with your With a pinned tag such as
docker-compose.yml:terrificci/dnz:1.27.0, change the tag in docker-compose.yml first.
The log says when the database upgrade is done and DNS is listening.docker compose pull && docker compose up -d on each node, or the install script with
--only dnz-proxy.
A cluster
Upgrade one node at a time: the first node on the new version upgrades the shared database, the others keep answering meanwhile. Finish the other nodes soon after. See Cluster → Upgrading. With replication, upgrade the primary and its secondaries to the same version.Going back
Stop DNZ, put the backup back in place of the database (for SQLite, remove anydnz.db-wal and
dnz.db-shm next to it, or restore the dump with pg_restore / mysql), then start the version
you came from. Changes made after the upgrade are lost. A DNZ archive restores onto the version that
made it.
Breaking changes
Newest first. Upgrading across several versions at once is fine: what each one needs applies on the way.v2.0.0
- The copy DNZ makes. Before dropping anything, DNZ copies a SQLite database (and the Redis
backend’s local copy) to
backups/before-cleanup-<time>.dbin the folder of the database:/var/lib/dnz/backups/with systemd,/data/backups/in the Docker volume. With Postgres or MySQL, DNZ makes no copy: take a dump before upgrading. - Going back. After this upgrade, going back to an older version needs that copy or your own backup (v1.27 could still go back to v1.26 without one); see Going back.
- Straight from v1.26 or older. Allowed: the proxy services are moved into upstreams first, as
in v1.27.0 (below), then the old tables are dropped. DNZ makes one copy before both,
backups/before-upstreams-<time>.db. Check the proxies on a copy of the database before upgrading, as v1.27.0 describes, with the new version’s image. - Middlewares and firewalls are every proxy’s. Each proxy’s middlewares, firewalls and TCP
middlewares are merged once into one list, Proxy → Middlewares. The same name with other
settings on another proxy is renamed after that proxy (
office-edge2): a Traefik’s own routers (Docker labels, files) namingdnz-office@httpthere must namednz-office-edge2@http. DNZ copies a SQLite database (and the Redis backend’s local copy) tobackups/before-v2-<time>.dbfirst. See From per-proxy middlewares. - Transports become an upstream’s connection settings. An upstream that proxies connected to
differently is split (
<upstream>-<proxy>), and Caddy proxies start applying an upstream’s connection settings. See From per-proxy transports. - Sites in DNS becomes read-only proxies. Every Caddy and Traefik under Settings → Proxy →
Sites in DNS becomes a read-only proxy with the same settings (API and
password, addresses or CNAME, TTL, read interval, add only, paused, division) and the same
records, which it keeps managing. It keeps its name, or becomes
<name>-siteswhen a proxy already has that name. Records lose thecaddy_id,origin_portandorigin_httpsfields.dnz caddyis nowdnz proxy sites, and the API moved from/api/divisions/{id}/caddiesand/api/caddies/{id}to/api/proxy-sitesand/api/proxies/{id}/sites. See Upgrading from v1. - Metrics renamed.
dnz_caddy_sync_successanddnz_caddy_sync_timestamp_secondsare nowdnz_proxy_sites_sync_successanddnz_proxy_sites_sync_timestamp_seconds, labelledproxyandkind. The old names are still exported for one release: move dashboards and alerts to the new ones. See Prometheus. - Check first.
dnz proxy advanced-check --database <copy>, run with the new version’s image on a copy of the database, lists every merge, rename and split before you upgrade, and each Caddy and Traefik of Sites in DNS with the read-only proxy it becomes (see Checking a proxy setup). - Proxy YAML. Exports are
version: 2and hold TCP and UDP routes and each upstream’s connection settings. Version-1 files still apply; one naming a middleware or upstream the upgrade renamed is refused with the new name. See Configuration as code. - API.
/api/proxies/{id}/servicesis gone (v1.27 answered410 Gone). Use/api/proxy/upstreamsinstead./api/proxies/{id}/middlewaresanswers410 Gonetoo: use/api/proxy/middlewares. - Certificate checks per server. An upstream’s accept any certificate switch moves onto each of
its HTTPS servers (Skip TLS verification on the server’s badge,
skip_tls_verifyon each server in the API and proxy YAML), so nothing changes for visitors. Skipping it per server is DNZ Proxy only: on Traefik and Caddy, an upstream mixing servers that skip the check with servers that don’t has every server’s certificate checked, with a warning on the proxy page. See Certificate checks per server. - CLI.
dnz proxy middlewares add|edit,dnz notify add|setanddnz backup targets add|settake their settings with--settingsinstead of--config(it clashed with the config file flag-c/--config).dnz dhcp leases --searchis-qfor short, no longer-s. List commands that page print the API’s page with--json({zones, total, page, per_page}and so on) instead of a bare array, anddnz proxy routes list --jsonprintsrowswith each proxy’s copy inentries: scripts reading the old shapes need updating. - From v1.15 or older. The server loses the query log those versions kept in the main database: it is dropped during the upgrade, in one step, with nothing to wait for (v1.16 and later keep the query log in day files). See Upgrading to the day files.
v1.27.0
Every proxy’s services became shared upstreams on Proxy → Upstreams: services identical in content became one upstream, the same name with other servers stayed apart, and nothing visitors get changed. See Upstreams.-
DNZ copied a SQLite database to
backups/before-upstreams-<time>.dbnext to it before the move. With Postgres or MySQL, take a dump before upgrading. -
The proxy page’s Advanced tab is gone. To see before upgrading which routes hold settings only
the proxy’s YAML can change, check a copy of the database with the new version (read-only; the
running server isn’t touched):
Without Docker:
--databasealso takes apostgres://ormysql://URL of a restored copy. See Checking a proxy setup. -
/api/proxies/{id}/servicesanswers410 Gone: use/api/proxy/upstreams. - Going back to v1.26 still works.
v1.16.0
The query log moved out of the main database into one file per day on each server (logs/ next to
the database). The old log is not copied: Query Logs starts empty after the upgrade and fills up
from then on. The charts and top lists keep their history. With SQLite, dnz.db keeps its old size
until you run dnz db vacuum. See
Upgrading to the day files.