Skip to main content

Disposable backup and restore rehearsal

Imported component documentation. Source: melodee-project/melodee-api at commit 0267c458207082337d9baf1130deeb65f43c9d4a. Version 1.0.1. License MIT. Status: implemented-and-automatically-verified candidate; not published, deployed or production-qualified. This is the component's committed documentation, not proof of a distribution release or production qualification.

scripts/backup_restore_test.py creates two disposable melodee_test* databases, applies migrations to the source, inserts a minimal canonical Artist/Release/ Track/membership plus a verified media asset/location, dumps the source, restores it into the empty destination, copies the temporary storage volume and compares the canonical/asset rows.

bash scripts/dev-db.sh exec python3 scripts/backup_restore_test.py

Verified on 2026-11-29:

  • 16 canonical/job/schedule/review/auth/artwork rows matched after restore;
  • restored audio and artwork matched their stored SHA-256 digests and passed ffprobe;
  • the restored API became ready, returned the Track through authenticated search, and served a 206 ranged audio response;
  • two destination Storage Volume paths were updated before verification.

This is a disposable logical pg_dump/pg_restore rehearsal, not production point-in-time recovery, WAL replay, encrypted backup handling, NAS snapshotting or a full deployment runbook. The test never touches a non-melodee_test* database.

Extended rehearsal (2026-11-30)​

The disposable rehearsal now seeds and compares 29 rows across canonical catalog, assets/locations, jobs/schedules, ingestion reviews, accounts, auth families/sessions, a verified contact, a passkey and its protected-object reference, artwork, favorites, a rating, a dislike, a playlist with a repeated Track occurrence, a dated listening event, a historical play summary, a public share and a user-state import plan. Both media files and the artwork bytes were restored with matching SHA-256 digests from two volumes, and the restored API served readiness, search and 206 ranged playback.

Command:

bash scripts/dev-db.sh exec bash -c 'python3 scripts/backup_restore_test.py'

This remains disposable: off-host storage, PITR, encryption-key recovery, a real library size and production-like infrastructure are external qualification.