ASQL docs / How-to guides

Back up and restore

Back up a running server

sudo /opt/aios/bin/asql-export.sh -o /backup/asql-$(date +%F).tar.zst

The server keeps running. The backup is one consistent point in time and holds the tables, views, Things, Cells and the replication position, plus a .sha256 next to it. The extension picks the compression: .tar.zst, .tar.gz or .tar.

Users and capability keys live outside the store and are not in the backup; copy /opt/aios/root/capability-users and /opt/aios/root/capability.key separately if you need them.

Restore

sudo /opt/aios/bin/asql-import.sh /backup/asql-2026-11-06.tar.zst

It checks the .sha256, stops the service, puts the store in place, starts the service and waits until it answers.

OptionEffect
--forcereplace an existing store; the old one is moved aside, not deleted
--keep-replication-statekeep the replication position (restoring a mirror to the same source)
--no-startleave the service stopped

Without --keep-replication-state, a mirror restored from a backup copies its tables from the source again.