Skip to main content

Database Backup & Restore

Nightly backups with per-institution SQL dumps.

Backup Types

  • Daily: Full database dump + per-institution COPY-format SQL files
  • Manual: Triggered from the admin backup dashboard

Per-Institution Dump

Each institution gets a institution_{ID}_{Name}.sql file containing:

  • Direct tables: Tables with an InstitutionID column (filtered by WHERE InstitutionID = @p0)
  • Indirect tables: Child tables without InstitutionID that link via FK chain (e.g., LoanSchedules → Loans → InstitutionID)

Restoring

  1. Admin → Backups → select a backup → Restore → choose institution(s)
  2. The restore deletes existing institution data (children first, then parents)
  3. Then executes the per-institution SQL file
  4. Finally resets all identity sequences

Verification

After restore:

  1. Verify trial balance (total debits = total credits)
  2. Run an EOD recompute
  3. Check that all indirect tables (LoanSchedules, LoanScheduleFees, etc.) are populated

Configuration

KeyDefaultDescription
Backup:StoragePath/var/backups/corewaveWhere backup ZIPs are stored
Backup:PgDumpPath/usr/bin/pg_dumppg_dump binary path
Backup:EncryptionKeyderived from JWT keyAES-256-GCM encryption key