Operations
Backups & restore
backup_now(), which snapshots the panel host's own filesystem state, and the panel's /backups page, which lists/downloads/restores/deletes backups and pulls node-level restorable state over RPC._authed.backups.tsx renders a list of backups with download / restore / delete actions. Clicking Restore asks for confirmation, then calls api.backups.restore(id). Node-level restorable state is not stored inside these panel backup archives by default — it is captured separately, on demand, via the node RPC method backup.snapshot, and only bundled in when a fleet-wide backup explicitly requests it.
Panel-side (backup_now())
The CLI backup is a single command:
tar -czf /root/autoscript-backup-<timestamp>.tar.gz \
/etc/autoscript \
/var/lib/autoscript \
/usr/local/etc/xray| Path | Contains |
|---|---|
| /etc/autoscript | agent.env (secrets, ADMIN_HASH, panel port/path/domain), TLS material, SSH banner config. |
| /var/lib/autoscript | panel-state.json fallback (used when /etc is read-only under systemd sandboxing) — without this, a restore comes back with empty usage/settings. |
| /usr/local/etc/xray | The panel-host's own local-node Xray configuration. |
The SQLite database lives under /etc/autoscript or /var/lib/autoscript
DB_PATH in agent.env) and it lives inside one of the two backed-up directories, so the CLI backup is a full logical + config backup, not config-only.Node-side (RPC backup.snapshot)
POST /rpc/backup.snapshot returns restorable node state: the Xray config, the ZIVPN config, users.rev, quota.json, vpn-traffic.json, and the account list — secrets (BEARER, SHARED_SECRET, TLS private key) are explicitly excluded, so a snapshot alone cannot be used to impersonate the node; it captures state, not identity.
- Panel CLI backup
/root/autoscript-backup-<YYYYMMDD-HHMMSS>.tar.gzon the panel host's local disk.- /backups page entries
- Whatever the panel backend persists per backup job (id, timestamp, size) — download serves the archive back to the browser.
- Node backup.snapshot
- Returned inline in the RPC response (JSON), not written to disk on the node; the panel is responsible for persisting it if it wants it retained.
backup_now() is on-demand only — there is no cron/timer wired up for it in cli.sh or the systemd unit set; it runs exactly when triggered from the menu (option 11), the autoscript backup flag, or whatever schedule an operator wires up themselves (e.g. a cron entry calling autoscript backup). There is no automatic retention/pruning of old archives in /root — old autoscript-backup-*.tar.gz files accumulate until removed manually.
Recommended pattern
autoscript backup, and a second job that copies the newest archive off-box and deletes local copies older than your retention window.# /etc/cron.d/autoscript-backup
0 3 * * * root /usr/local/bin/autoscript backup >/var/log/autoscript-backup.log 2>&1
30 3 * * * root find /root -maxdepth 1 -name 'autoscript-backup-*.tar.gz' -mtime +14 -deleteVortexa does not ship a built-in off-box uploader (no S3/rsync integration in cli.sh). Treat every autoscript-backup-*.tar.gz as sensitive (it contains agent.env, which hasADMIN_HASH, node bearer/shared secrets, and TLS keys) and copy it off the VPS yourself, for example:
scp root@panel-host:/root/autoscript-backup-*.tar.gz /secure/offsite/backups/
# or
rsync -avz root@panel-host:/root/autoscript-backup-*.tar.gz /secure/offsite/backups/- 1Provision a fresh Ubuntu/Debian VPS with the same DNS A/AAAA records the old panel used (or update DNS afterward and expect a propagation delay before nodes/clients can reach it).
- 2Copy the latest
autoscript-backup-*.tar.gzonto the new box (scp/rsync), e.g. into/root/. - 3Run
install.shfresh on the new VPS exactly as for a first-time install (installs OS packages, Xray, nginx, stunnel, the venv, and systemd units) — do not skip this even though you have a backup, because the archive only contains config/data, not the installed binaries/services. - 4Stop the freshly-installed stack before overwriting its config:
autoscript maintenance on, thensystemctl stop autoscript-web autoscript-agent autoscript-bot autoscript-ssh-ws xray nginx. - 5Extract the archive over the fresh install's data directories, replacing the just-generated fresh config with your real one:bash
tar -xzf /root/autoscript-backup-<timestamp>.tar.gz -C / - 6Verify
/etc/autoscript/agent.envpermissions are still0600(it holds secrets) and thatPANEL_DOMAIN/PANEL_PORTmatch the new box's intended DNS. - 7Re-run
backend/scripts/apply_settings.sh(or the CLI's "Change panel domain" action) so TLS is reissued for the new host if the domain/IP changed. - 8Run
autoscript repairto make sure Xray/stunnel/nginx configs are reconciled against the restored settings. - 9Bring the stack back with
autoscript restart(this also lifts maintenance once the web port answers). - 10Log in and check
autoscript status: confirm the admin user, release version, and that every listed service is active. - 11For each fleet node, its pinned handshake fingerprint is stored on the panel side (in the same restored database/state), so nodes should re-associate automatically on their next heartbeat — verify on
/nodesthat every node flips back to Online. If any stay on "fingerprint mismatch", use Force re-pin (see Troubleshooting).
Node-side state is not restored by this runbook
backup.snapshot for it, push that snapshot back down via backup.restore_latest (RPC, 180s timeout) rather than trying to hand-copy Xray/ZIVPN config files.