-
Notifications
You must be signed in to change notification settings - Fork 0
Maintenance and Backups
Parent section: Operations
Maintenance covers backups, restore tests, storage cleanup, migrations, doctor checks, service health, and support bundles.
Relevant dashboard pages:
-
/admin/maintenance- backups, release status, restore tests, checksums, config restore, bot heartbeat, storage forecast, rollback queue, and health. -
/admin/media- orphaned/missing media, oversized media, quarantine, thumbnails, compression, old-history archives, and lifecycle controls. -
/admin/jobs- long-running maintenance jobs. -
/admin/install-doctor- install/doctor status. -
/admin/optimization- performance presets, cache metrics, storage forecasts, notification presets, queued maintenance, and watchdog status. -
/admin/production-health- production health score. -
/admin/server-health- per-server setup/storage/backup/game/library/achievement status.
Backups should protect:
sdac.dbconfig.jsonmedia/- environment files
- deployment scripts/configuration
Do not commit real backups to Git.
Restore testing is important because a backup that has never been restored is only a guess.
Common command:
cd /home/ubuntu/discord-screenshot-bot
bash scripts/test_restore.shSpecific backup:
bash scripts/test_restore.sh /home/ubuntu/discord-screenshot-bot/backups/sdac-BACKUP.dbOffsite backups can use rclone-backed providers such as Google Drive, OneDrive, Dropbox, Mega, S3, Backblaze B2, Box, and SFTP.
Example shape:
sudo apt install rclone
rclone config
SDAC_RCLONE_REMOTE=drive:sdac-backups bash scripts/backup_offsite.shDo not put rclone secrets, provider passwords, private keys, or token files in the wiki.
Per-server backups export guild-scoped configuration, database rows, and media. The server-specific backup flow should not leak one server's private data into another server's export.
Local media cleanup after remote upload should stay disabled unless the remote media is reachable and tested.
Media can optionally be mirrored to a cloud/public bucket. If a public prefix is used, set the environment variable name only in docs:
SDAC_MEDIA_PUBLIC_BASE_URL
Run migrations after updates that change schema:
cd /home/ubuntu/discord-screenshot-bot
venv/bin/python scripts/migrate_database.py --db sdac.dbOld full submission history can be archived while preserving monthly top 10 snapshots:
venv/bin/python scripts/archive_old_history.py --months 18Remove exported rows from the live table only after verifying the archive:
venv/bin/python scripts/archive_old_history.py --months 18 --delete-exportedsdac-doctor checks install health. If it fails with /usr/bin/env: bash\r, the wrapper/script has CRLF line endings and must be converted to LF.
Doctor warnings about missing Discord token or OAuth credentials mean the server env file needs variable values; never paste those values into the wiki.