Skip to content

Implement convenience backup and restore strategy#133

Merged
michael merged 26 commits into
tpfrom
backup-and-restore
Jul 12, 2026
Merged

Implement convenience backup and restore strategy#133
michael merged 26 commits into
tpfrom
backup-and-restore

Conversation

@michael

@michael michael commented Jul 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

@vercel

vercel Bot commented Jul 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
editable-website Ready Ready Preview, Comment Jul 12, 2026 10:10pm

@michael michael changed the base branch from ccm to tp July 10, 2026 12:06
michael added 2 commits July 10, 2026 16:19
Each site now lives in its own checkout with its own repo, with
Editable kept as the upstream remote for upgrades. Consequences:

- data.sh resolves the app like the fly CLI: -a flag > FLY_APP env >
  app in fly.toml, and trims whitespace from flyctl machine ids
- Backup names include the app name so data-backups/ stays readable
  across sites
- fly.toml carries region, VM sizing, and volume initial size, so the
  first deploy is just `fly deploy`
- npm scripts cover all data commands (pull/push/backup/backups/
  restore), parameterless
- New src/custom.css is user-owned and never touched by upstream,
  keeping `git pull upstream main` conflict-free
- README: "Your site is your repo" setup flow (upstream/origin),
  parameterless deploy guide, -a documented as escape hatch, and a
  new Upgrading section
Three failure modes found while testing push against a live app:

- remote-db.sh: force `sqlite3 -list -noheader` when parsing
  integrity_check output — newer sqlite3 CLIs render box tables on a
  tty (fly ssh allocates one), which broke the comparison against 'ok'
  and aborted the push before the swap
- data.sh: clear remote staging leftovers (clean-incoming) at the start
  of push, pull, and restore — sftp put and VACUUM INTO refuse to
  overwrite files left behind by an interrupted run
- data.sh: set COPYFILE_DISABLE when tarring assets so macOS tar omits
  xattr headers that GNU tar on the server warns about

The sqlite3 fix lives in the container image, so it takes effect on the
next `fly deploy`.
- data:help (npm run data:help): command reference with arguments,
  the npm -- separator rules, and where <name> and <ts> values come
  from; unknown data.sh subcommands print it too
- Backup names now use UTC timestamps in filename-safe ISO 8601 basic
  format (my-site-20260712T143535Z-3f2a), directly comparable to cloud
  restore points and fly logs; --at stays RFC3339, matching litestream
- data:reset now moves assets aside (data-backups/local-<ts>-assets/)
  instead of deleting them, prints the undo steps, and empties data/
  rather than removing it so a symlinked data dir keeps working
- README: clarify that snapshots/restore target the live site, note
  where restore names come from, document data:help
Snapshots now use the same .sqlite3 extension as the live database
file, on the volume and in data-backups/ — no more .db vs .sqlite3
confusion. No migration: nothing depends on the old names yet.

data:reset no longer wipes the data folder. It snapshots the database
to data-backups/, deletes only db.sqlite3 (+ WAL/SHM), and leaves
assets in place — the content-addressed pool is append-only, and files
the fresh database doesn't reference age out via the grace-period
sweep. This makes reset a low-stakes operation and keeps data-backups/
a flat folder of database snapshots.
@michael michael merged commit 3ec80e5 into tp Jul 12, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant