Update rehearsal: downgrade check for deploys, -N versions, failed logs

coreapp deploy refuses a lower version than the installed one without
--downgrade, as coreapp install does. Versions with -N (the Coreapp's own
fix on the same upstream version) order after the upstream one, for
releases too. A failed start keeps the container's whole log, from its
first start, in <name>-failed-start.log. coreapp status shows the
installed version beside the folder's.

Skill: references/updating.md (versions, what to check between versions,
testing an update over real data and its rollback, no copy after a
successful update); reading the installer's bash -x log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-04 14:06:31 -07:00
co-authored by Claude Opus 5.5
parent 491af8745f
commit 0aa334d22a
8 changed files with 168 additions and 18 deletions
+69
View File
@@ -0,0 +1,69 @@
# Updating an app: a new upstream version, or a new release of your own
Read this before moving an installed app to a new version (a newer
upstream image, or your own app's next release). SKILL.md has the deploy
and publish commands around it.
## Versions
`version` in `coreapp.toml` is the image's tag and the release's
(`v<version>`). For a port, follow upstream's version (`6.2.0`); for a
release that changes only the Coreapp on the same upstream version (the
entrypoint, a setting), add `-N` (`6.2.0-1`, `6.2.0-2`): the Core orders
`6.2.0` < `6.2.0-1` < `6.2.1`. Raise it for every release; while you're
trying things on your own Core, you don't need to.
A Core refuses an older version than the one it has, unless asked:
`coreapp deploy --downgrade` from a folder, `coreapp install --downgrade`
from a repository. That's for the user to decide: an older version may not
understand what the newer one left in its database and `/data`.
## Before: what changes
- Read upstream's release notes for every version in between (not only
the newest), their upgrade steps and their migrations (in the source:
`migrations/`). Note migrations that can't be undone (data rewritten,
tokens hashed) and slow ones (rebuilt indexes or views on big tables).
- Check what your Coreapp writes still fits: the settings your entrypoint
maps or writes into the database (renamed or moved keys), the upstream
entrypoint and `CMD` your entrypoint ends with, the image's user, ports,
`VOLUME`s and `HEALTHCHECK` (`docker inspect` both images and compare),
and a new minimum database version (`min_version`).
- "Back up the database first", in upstream's steps, is done by the Core:
before every update it copies the app's database (and `/data`, where
its filesystem can do that instantly) and rolls back to that copy if the
new version doesn't start. Upstream's own upgrade command (`--upgrade`,
`migrate`) belongs in the entrypoint, so it runs at every start.
## Testing an update
Test it over an install that has real data, not a fresh one:
1. Deploy the version people run now (a copy under another `name` is
fine), and use it the way people do: content, a changed setting, an
upload, a `coreapp signin`. Commit that as the released version.
2. Record what's there (through the app's API or SQL as its database
user), so you can compare after.
3. Deploy the new version over it and compare: the data, the settings
the Core writes (sign-in and mail still work), sessions, uploads. Sign
in again, and as a brand-new account (`coreapp signin --remove-account`
first): new versions change first sign-in and roles.
4. `coreapp deploy --recreate` once more on the new version.
To see a failed update roll back, deploy a throwaway version (say
`6.2.0-failtest`, not committed) whose entrypoint runs the migrations and
then exits: deploy says "Rolled back", and the old version runs with its
database as before. A throwaway version is needed: when the version isn't
raised, the image that failed is the one running again. The failed
container's whole log, from its first start (where the migrations ran),
is kept on the Core; deploy prints where.
## After: there's no copy to go back to
The Core's copy of the database is only for the update itself: once the
new version answers, it's deleted. If a problem shows up later, the way
forward is a fixed release (`-N`); going back to the older version means
the older version on the newer data (refused without `--downgrade`, and
often broken by migrations it doesn't know), or the Core's own backups,
which are the user's. Say this in your report when an update has
migrations that can't be undone.