{{define "title"}}Backups - Email Server{{end}} {{define "content"}}

Backups

Whole-server backup

Downloads a single archive of everything under server_data/ — the database, every mailbox's encrypted mail, and the master key that decrypts it. The database is snapshotted consistently (SQLite's VACUUM INTO) so the backup is never caught mid-write, even while the server keeps running.

Losing the master key makes every mailbox's stored mail permanently unrecoverable, even for an admin. This one archive contains everything needed to restore the whole server — store it somewhere separate from this machine, and set a passphrase below if it might end up somewhere you don't fully trust.
Scheduled backups

Automatically writes an unencrypted whole-server backup straight to a folder on this machine (not the browser) on the interval below, and deletes the oldest ones once more than "keep" exist. Manual (the default) means nothing runs automatically — use "Run backup now" or the download button above whenever you want one.

Backups on disk ({{.backup_dir}})
{{if .scheduled}} {{range .scheduled}} {{end}}
FileSizeWritten
{{.Name}} {{filesize .Size}} {{strftime "%Y-%m-%d %H:%M:%S" .ModTime}}
{{else}}

No backups written to this folder yet.

{{end}}
Restoring

Restore is a command-line operation, not a button here — it replaces every file under server_data/ wholesale, including the database this running process has open, which isn't safe to do to a live server from inside its own web UI. Stop the server, then run:

./mailgoserver -restore-server -in backup.tar.gz [-restore-passphrase "..."] [-force]

-force is required if server_data/ isn't already empty. -restore-passphrase is only needed for an archive that was downloaded with a passphrase set.

{{end}}