Appearance
Upgrade (waap upgrade)
The waap upgrade commands check a new version against the store, back up, migrate, and roll back if needed. The install guide has the full procedure, in its "Upgrade and rollback" section (docs/install-guide.md).
All subcommands take:
-data-dir DIR: default/var/lib/waapwhen it holds a database, elsedata.-runtime-dir DIR: as for the other admin commands.
Exit codes: 0 means ok, 1 means refused or failed, 2 means bad usage.
waap upgrade check
Changes nothing. It prints:
- the store's schema and the release it came from
- the target binary's version and schemas
- the configuration file's format, and whether the file and the store's active configuration are readable by the target
- free disk space against the estimate for the backup
- the HA peer's version, when a node is running
Each refusal is a REFUSED: line. Refusals cover:
- the store is newer than the target (a downgrade)
- the store is from a development build
- the configuration is unreadable
- there is too little disk
- the target is more than one minor version ahead of the peer
sh
waap upgrade check [-config FILE] [-data-dir DIR] [-backup-dir DIR] [-to BINARY] [-allow-unreleased] [-json]| Flag | What it does | Default |
|---|---|---|
-config FILE | Configuration file to check. | |
-data-dir DIR | Data directory. | see above |
-backup-dir DIR | Where backups are written. | <data-dir>/backups |
-to BINARY | Asks that binary to check the store (waap upgrade info; v0.2 or later). | the running binary |
-allow-unreleased | Accepts a store from a development build. Also set by WAAP_UPGRADE_ALLOW_UNRELEASED=1. | off |
-json | Prints the report as JSON. |
waap upgrade run
Checks, then backs up, then migrates.
sh
waap upgrade run [check flags] [-backup-only] [-passphrase-file FILE] [-events auto|yes|no]- The backup is
pre-<version>-<time>.waapbakin the backup directory, in the old binary's format. It has a random passphrase in<file>.key(mode 0600), unless-passphrase-filenames one (at least 12 characters). - The backup is read back to verify it. If that fails, the command stops with "nothing was changed".
- Migration needs the node stopped. It is refused while a node answers on the runtime directory.
-backup-onlywrites the backup and stops. This is the package hook. The old node may still be running.-eventsincludes security events.auto(default) includes them up to 512 MiB of database.yesandnoforce it.- A store already at the target schema is reported, and nothing is written.
- After a good backup, or when there is nothing to migrate, it removes
<data-dir>/upgrade-blockedand says so. That marker is left by a package when its pre-upgrade backup failed. The units refuse to start while it exists.
waap upgrade rollback
Restores the old version's state. Needs the node stopped.
sh
waap upgrade rollback -old-binary BINARY [-backup FILE] [-backup-dir DIR] [-passphrase-file FILE] [-data-dir DIR] [-dry-run]It moves waap.db and traffic.db to <data-dir>/rolled-back-<time>/. Then it runs BINARY restore with the newest pre-*.waapbak, or with -backup if given. The passphrase comes from <backup>.key, or from -passphrase-file. A failed restore puts the files back.
Start the old version afterwards.
waap upgrade info
Prints this binary's version, store schema, traffic schema, configuration formats and backup format, as JSON. upgrade check -to reads this output.
sh
waap upgrade info