# SqlVault
A Windows client-side backup agent that backs up SQL Server databases into a single vendor-owned Google Drive account, organized per customer. Customers never touch Google credentials; storage belongs to the vendor.
System Diagram
Overview
SqlVault is a Windows client-side backup agent that backs up SQL Server databases into a single vendor-owned Google Drive account, organized per customer. Customers never touch Google credentials; storage belongs to the vendor. A single Windows Service hosts a Quartz scheduler, backup orchestrator, localhost API, and Blazor Server dashboard. The validation pipeline gates every run: preflight checks (ACL, disk, DB allowlist, SQL connection), BACKUP DATABASE, RESTORE VERIFYONLY, a deep restore to a scratch database with a health probe, AES-256-GCM encryption, ZIP v3 packaging, Google Drive resumable upload, and cleanup. DPAPI secures SQL and Google credentials; RSA-signed time-limited support tokens unlock on-site technician setup bound to an Installation ID. GFS retention, scheduled revalidation, missed-backup recovery, and dual-audience email notifications round out the operational model. The product targets SQL Server Express users who lack SQL Server Agent, and ships as an MSI installer with a Setup.exe bootstrapper, gated by E2E tests against a real SQL Server 2022 instance.
Problem
Small businesses running SQL Server Express have no SQL Server Agent for scheduled backups, and managed backup services add a cloud intermediary that owns customer data. Vendors need a way to run scheduled, verified, encrypted backups into their own storage without exposing customer credentials.
Approach
Single Windows Service hosts a Quartz scheduler, backup orchestrator, localhost API, and Blazor Server dashboard. The validation pipeline gates every run: preflight (ACL, disk, DB allowlist, SQL connection) -> BACKUP DATABASE -> RESTORE VERIFYONLY -> deep restore to a temp DB -> AES-256-GCM encryption -> ZIP v3 packaging -> Google Drive resumable upload -> cleanup. DPAPI secures credentials; RSA-signed time-limited support tokens unlock on-site setup. GFS retention, scheduled revalidation, and point-in-time restore chains round out the operational model.
Impact
- * Ships as an MSI installer with a Setup.exe bootstrapper; release-gate E2E tests run against a real SQL Server 2022 instance before tagging.
- * Validation pipeline proves restorability end-to-end: VERIFYONLY plus a deep restore to a scratch database with a health probe before upload.
- * Vendor-owned storage model keeps customer data in one Google Drive account, organized by auto-created customer folders, with no customer Google credentials involved.
- * Background intelligence handles GFS retention, 7/30-day revalidation, missed-backup recovery, and dual-audience email notifications (admin detail vs. customer summary).
Architecture
SqlVault is a single-process Windows Service that fuses a backup engine, scheduler, localhost API, and Blazor Server UI. The pipeline is a sequence of gates, each of which can fail the run, with background services handling retention, revalidation, and missed-run recovery.
Guardrails
- * License expiry hard-suspends backup workers; the dashboard stays visible with remaining days.
- * Temp .bak path is ACL-locked to the service account and Administrators; world-readable temp fails the preflight gate.
- * Background intelligence runs GFS retention, 7-day VERIFYONLY revalidation, and 30-day deep-restore revalidation on uploaded backups.