← All projects

Recovery verification · Systems tooling

Backup restore checks

A tool that restores a database and its attachments into a temporary workspace, checks that they agree, and records any missing or damaged files.

Recovery tool with executed fault drills and a theoretical deployment run

Recorded acceptance and rejection of four synthetic backup fixtures.
Recorded acceptance and rejection of four synthetic backup fixtures.

Implementation

The runner verifies a backup manifest, restores the database with SQLite's backup API, extracts permitted archive members, and probes the recovered application data.

Database checks cover integrity, foreign keys, snapshot identity, visit count, and valid record fields. Attachment checks compare the manifest, database references, restored paths, byte sizes, and hashes.

Each run owns a fresh temporary directory and removes it after success or failure. It accepts no destination database path, and tests confirm source bytes and unrelated files remain unchanged.

An operational runner kills disposable restore processes, verifies supervised cleanup and retry, captures a live WAL snapshot, and evaluates PostgreSQL recovery control flow and transfer budgets as explicit theoretical models.

Inputs and assumptions

  • The supplied backup set contains 24 synthetic service visits and 24 text attachments.
  • Inputs are local and remain unchanged while checking. A manifest binds database and archive hashes to the expected snapshot and files.
  • Archives contain regular files only and remain within the documented file-count and size limits.

Results

Recorded results for the included reference case
Automated checks passed13 / 13
Expected fixture outcomes4 / 4
Records and attachments in the valid set24 visits / 24 files
Mixed-snapshot resultDatabase restored; application probes rejected it
Operational and theoretical acceptance checks11 / 11
Report figures (1)
The mixed-snapshot database restores successfully but fails the application checks. Other damaged sets are rejected before restoration completes.
The mixed-snapshot database restores successfully but fails the application checks. Other damaged sets are rejected before restoration completes.

Open the full report ↗

Verification

13 regression tests and four fixture outcomes passed, plus 11 operational acceptance checks covering real process death, parallel restores, online snapshots, size limits, storage faults, and modeled PostgreSQL recovery.

python verify.py
Download the verification record ↓

Additional scenarios

11 outcomes checked through executed synthetic operations. The report lists the expected and observed outcomes for each check.

Read the validation report ↗

Project files

The ZIP contains the source, inputs, results, and instructions. These files are also available individually.

Download project ZIP · 96 KB
Archive checksum

SHA-256

167227bb40ac71d6572e25fe696c0a850bad0b4afb54ad9407b009e0b75d90b7
Original project scopeArchived brief PDF ↗

Run locally

Python 3.10 or newer with SQLite / Python standard library / Linux for the subprocess SIGKILL operational drills

Extract the ZIP and open a terminal in the backup-restore-checks folder. The README includes setup and usage details.

python restore_check.py fixtures/good --report results/manual-good.json
python verify.py
python operations.py

Limits

  • SQLite restoration, subprocess crashes and data/file probes are executed. PostgreSQL and remote transfer are modeled; no PostgreSQL server or network transfer performance is claimed.
  • The unsigned manifest detects accidental changes but does not establish authenticity.
  • SIGKILL tests retain normal host storage behavior. ENOSPC is injected; neither qualifies power loss or physical disk failure.
  • Local and modeled timings use small declared fixtures or assumed rates. They are not production recovery guarantees.