Updates, backups & recovery
Preserve the database, keys, and deployment identity.
Back up before changing versions#
Preserve PostgreSQL, secrets/master-key, deployment configuration, and relevant integration keys. Keep the bootstrap token with protected instance secrets. Store a database backup and the master key separately from the host.
For a standalone Compose deployment:
umask 077
docker compose exec -T database pg_dump -U asemail -d asemail -Fc > asemail-backup.dump
test -s asemail-backup.dump
This creates a local backup file and checks it is nonempty; it does not prove a successful restore. For the mailcow child, the database service is asemail-database and the correct parent Compose project/configuration must be selected.
Update a source-built instance#
Review the target version and schema changes first. With matching source and your preserved environment:
docker compose build --pull
docker compose up -d
docker compose ps
For a private GHCR deployment, obtain and verify the new release's immutable digest and attestations first. Set ASEMAIL_IMAGE to that digest, pull the API/worker images, and start with --no-build. Do not mix a released image with newer beta adapter files.
Check after updating#
Confirm service health, mailbox sign-in, a read, controlled send, Outbox outcome, and Sent copy. Native mailcow sign-in/logout and settings need separate checks if enabled. Read Verify, update & recover.
Restore and rollback#
Restore a compatible PostgreSQL backup and the exact same master key before starting the API and worker. Test restores in an isolated environment. Keep the application version compatible with the restored schema.
An image rollback is not necessarily a database rollback. Do not point an older image at a migrated database without reviewing compatibility. Never replace an existing master key to fix a decryption error.
Data boundaries#
Mail remains on the upstream server, but calendar events, settings, encrypted connections, caches, and Outbox recovery content belong to aseMail. An IMAP-only backup is not a backup of those application records.