Skip to content
bitzorcas
中EN

Guide

Backup, restore, and disaster rehearsal

Define RPO/RTO, recovery order, and rehearsals for databases, objects, messaging, Redis key rings, configuration, and artifacts.

Last updated

A successful backup job does not prove recoverability. BitzOrcas business facts, objects, message progress, Data Protection keys, and configuration are related and must be tested on one recovery timeline.

Critical path diagram

Follow the main path to identify responsibility handoffs, then use the prose to inspect failure branches and evidence.

Declare incident

Fence unsafe writes

Restore data and secrets

Verify invariants

Reopen with monitoring

Define the target

  • RPO: maximum acceptable data loss after failure;
  • RTO: time from disaster declaration to restored critical service;
  • scope: one tenant, one database, a region, or a provider;
  • consistency point: how database, objects, and messages return to an explainable shared point.

Different data can have different targets, but a customer commitment must account for the slowest critical dependency.

Assets to protect

AssetMinimum requirement
SQL Server/PostgreSQLFull plus log/incremental backups, regularly restored in isolation
S3/MinIOVersioning, lifecycle, cross-region/offline copy, and reference reconciliation
RedisSeparate disposable cache from critical Data Protection keys and idempotency state
RabbitMQ/CAPPersistence, dead-letter/backlog monitoring, and idempotent redelivery after restore
Configuration/secretsVersioned configuration, secret re-issuance, and access audit
Release artifactsPreserve images, packages, SBOM, provenance, and migrations as one version

Suggested recovery order

  1. Stop writes and record failure time, last trusted commit, and message positions.
  2. Restore networking, secrets, database, and the Data Protection key ring.
  3. Restore object storage and run reference-integrity checks.
  4. Resume broker, CAP, and background work at a controlled consumption rate.
  5. Start read-only verification for tenancy, authentication, critical queries, and workflow state.
  6. Re-enable writes and watch redelivery, cache rebuild, count drift, and notification backlog.

Restoring the database before objects or messages is not automatically safe. Deletes, workflow completion, and integration events may require replay or compensation, with rules written before an incident.

Rehearsal acceptance

  • use production-equivalent encrypted backups, not developer snapshots;
  • restore into a clean environment with no original-machine residue;
  • measure actual RPO/RTO and record manual steps;
  • sample multiple tenants, dates, file downloads, login, approvals, and notifications;
  • convert findings into automation, monitoring, or explicit risk acceptance.

See database migrations and the production security checklist.

SQL Server backup and verification

BitzOrcas.DatabaseMaintenance implements Full, Differential, Log, VERIFYONLY, and confirmed Restore. The backup directory must be visible under the same path to SQL Server and the CLI; a remote server does not download files to the CLI machine.

Terminal window
# ① Create a full backup with a controlled operations identity.
dotnet run --project src/Tooling/BitzOrcas.DatabaseMaintenance -- \
--backup-database --backup-type Full \
--connection "$DB_MAINT_CONNECTION" --backup-dir "$BACKUP_DIR"
# ② VERIFYONLY proves readability, not a real restore or application smoke.
dotnet run --project src/Tooling/BitzOrcas.DatabaseMaintenance -- \
--verify-backup --connection "$DB_MAINT_CONNECTION" \
--backup-dir "$BACKUP_DIR" --backup-file "$BACKUP_FILE"

Under SIMPLE recovery, a log backup returns code 0 with Skipped=true. Automation must alert on skipped status or it can report a healthy chain that does not exist.

Isolated restore drill

Terminal window
# Run only against an isolated instance; Restore uses WITH REPLACE and has no dry-run.
dotnet run --project src/Tooling/BitzOrcas.DatabaseMaintenance -- \
--restore-database --connection "$ISOLATED_RESTORE_CONNECTION" \
--backup-dir "$BACKUP_DIR" --backup-file "$BACKUP_FILE" \
--database BitzOrcas_RestoreDrill --confirm RESTORE

The tool creates a pre-restore full snapshot. If restore then fails, that snapshot remains. Record partial state and ensure every external connection, broker, email, and webhook in the drill cannot target production.

Reconcile business facts

ScopeCheck
Identity and tenancymulti-tenant login, permission, cross-tenant denial
Filesdatabase references match object versions and download
Messagingoutbox/inbox state, backlog, duplicate consumption
Workflowinstances, todos, timers, timeline
Auditcurrent and cross-bucket records
License and keysDeploymentId, cache, Data Protection

Drill report

Record failure hypothesis, backup chain, hashes, SQL version, start/end, actual RPO/RTO, manual steps, failures, samples, and owners. A successful restore that misses customer RTO still fails acceptance.

Completion checklist

  • backup, VERIFYONLY, and real restore are separate evidence;
  • database, object, message, key, and configuration times are explainable;
  • the isolated environment cannot emit production side effects;
  • tenancy, files, workflow, audit, and messaging have post-restore smoke;
  • drill findings enter an owned automation backlog with due dates.

Keep the next drill date, owner, and open risks in the same report so one success is never treated as permanent recoverability.

100%

Scroll or use controls to zoom · drag when enlarged · double-click for 100% / 200%