Skip to main content

Backups and recovery

Incomplete

This page records what is known and marks what still needs deciding. The modernization initiative lists "automated database backups and tested restoration procedures" as a risk-mitigation item; until that is done, treat the gaps below as open work.

What exists​

ComponentState todayNotes
Production database (emawweb-server, Azure Database for PostgreSQL flexible server)Azure's built-in automated backups with point-in-time restore (default retention 7 days unless changed)Confirm the retention setting in the portal and record it here
Dev database (development-database-vm)No scheduled backup knownHolds the imported Planning Center contacts; a loss would mean re-importing
Azure Blob emawblob/mediaAzure storage redundancy; soft delete status unknownCover images, generated audio, embeddings parquet
Cloudflare R2 emaw-publicNo versioningResource media; keys are immutable, so accidental overwrite is unlikely, deletion is not recoverable
Redisredis_data volume; not backed upCache and queues only; nothing durable lives here
Qdrantqdrant_storage volume; rebuildable from the parquet in blobload_bible_embeddings recreates it
CodeGitHub
SecretsPassword manager, Portainer, Key VaultEnsure the password manager has the production .env too
Stripe, Deposco, ACS, Planning CenterVendor-heldStripe is the source of truth for payments

Recovery procedures​

Backend stack (VM lost)​

  1. New VM in the resource group, Docker installed, on the vnet (prod) or tailnet (dev).
  2. Clone the repo at main (prod) or develop (dev); restore .env from the password manager.
  3. docker compose up -d --build; load_bible_embeddings.
  4. Install the Cloudflare tunnel token (same token: the tunnel is remotely managed, so the hostname follows the connector).
  5. Prod: install Portainer and re-import the stack; re-whitelist IPs.

Production database​

Azure Portal → the flexible server → Backup and restore → point-in-time restore to a new server; update DB_HOST in the production .env; redeploy. Test this once before it is needed.

Dev database​

Decide: nightly pg_dump from the VM to the blob account, or convert dev to a flexible server with built-in backups. Open item.

Blob or R2 object deleted​

Blob: enable soft delete and record the retention. R2: re-upload from the source file; the resource's media_key in the admin app will need the new key.

Open items​

  • Record production backup retention and test a restore
  • Schedule dev database dumps
  • Enable blob soft delete
  • Decide on R2 bucket versioning or an off-site copy of resource media
  • Write the incident contact list and escalation on Who to ask