backup and restore
hostwall backup and restore: save HostWall to one file and restore it.
backup
Write a consistent snapshot of the database, the certificates, the dashboard certificate and the config file into one .tar.gz. HostWall can keep running.
| Flag | Default | Meaning |
|---|---|---|
--out <file> | hostwall-backup-YYYYMMDD-HHMMSS.tar.gz in the current directory | Output file |
sudo hostwall backup --out /tmp/hostwall-backup.tar.gz✔ Backup written to /tmp/hostwall-backup.tar.gz
It contains certificate private keys: keep it safe.The file is created with mode 0600. It contains certificate keys, the admin password hash and the 2FA secret: store it like a password.
Note
When run with sudo, the CLI writes the file as the hostwall user, which can't write to most home directories. Write to a directory it can write to, such as /tmp, then move the file.
restore
Restore a backup into the data directory, and its config file to the config path.
| Flag | Default | Meaning |
|---|---|---|
--force | off | Overwrite existing data and config |
Put flags before the file name:
sudo systemctl stop hostwall
sudo hostwall restore --force /tmp/hostwall-backup.tar.gz
sudo systemctl start hostwall✔ Restored data to /var/lib/hostwall
✔ Restored config to /etc/hostwall/hostwall.yaml
Start hostwall with `hostwall run`.Without --force, restore refuses to overwrite an existing database. If a config file already exists, the backup's config is written to <data_dir>/hostwall.restored.yaml instead, so you can compare them. Restored files are handed to the owner of the data directory.
Moving to a new server: install HostWall there, stop the service, restore, start the service, then point DNS at the new server.