Backup
Backing up an ANetBBS install.
What to back up
| Path | What's there |
|---|---|
data/anetbbs.db |
The sqlite database (everything) |
data/uploads/ |
User uploads + file library |
data/avatars/ |
Profile pictures |
data/text/menus/ |
Static per-menu ANSI/ASCII art overrides (welcome/goodbye/newuser/custom screens live in the DB — see data/anetbbs.db above, not here) |
data/echomail/ |
Inbound/outbound BinkP packets |
doors/ |
Door binaries & per-door state |
Source code itself isn't critical — restored from the install
tarball.
Quick weekly tarball
sudo tar czf /backup/anetbbs-$(date +%F).tar.gz \
--exclude=logs --exclude=__pycache__ \
/opt/anetbbs/data \
/opt/anetbbs/doors
Run that out of cron once a week, rotate keep-last-30.
Hot DB copy
sqlite's online backup API (.backup, not a raw file cp) gives a
consistent dump even while the BBS is writing — this is the same
mechanism update.sh uses for its own pre-update snapshot:
sudo -u anetbbs sqlite3 /opt/anetbbs/data/anetbbs.db \
".backup '/backup/db/anetbbs-$(date +%F-%H%M).db'"
cron this every 6 hours during the day if you want point-in-time
recovery. Admin → Backups lets you restore .env or the DB from an
existing update.sh-generated snapshot (or delete one) through the
web UI — there's no on-demand "download the live DB right now" button
there, so for your own off-site copies use the sqlite3 .backup
command above directly.
Off-site
Worst case, your house burns down. Push the rotated tarballs to an
off-site target — rclone to B2/S3, or rsync over SSH to a friend's
box.
Restore
- Stop the services.
- Untar the backup into a fresh tree.
chown -R anetbbs:anetbbs /opt/anetbbs/data- Start the services. Auto-sweep migrations will fix any
column-add diffs between the backup era and current code.