On this page:
snapshot-commerce-database!
backup-verification
verify-commerce-backup

12 Backup, verification and retention🔗ℹ

 (require commerce/backup) package: commerce

Server processes explicitly require commerce/backup. Backups are only evidence when they are verified against the running store.

procedure

(snapshot-commerce-database! database-path    
  destination-path) → void?
  database-path : path-string?
  destination-path : path-string?
Produces a consistent SQLite backup of a Commerce-owned database through SQLite’s online backup API, read-only on the source.

struct

(struct backup-verification (ok? details))

  ok? : boolean?
  details : hash?
The verification verdict with its checked details, including the backup’s schema version.

procedure

(verify-commerce-backup original-storage 
  backup-path 
  #:now now) 
 → backup-verification?
  original-storage : commerce-storage?
  backup-path : path-string?
  now : exact-nonnegative-integer?
Opens the backup read-only and verifies its schema version and recorded facts against the original storage. A backup that does not match the original’s schema version is not a usable backup.