Skip to content

Update the CMS

From inside the CMS repository:

Terminal window
pnpm run update

It pulls the latest code from upstream, installs dependencies, applies new D1 migrations, and redeploys the API and Admin Workers. It changes no configuration and does not touch your website.

upstream ─▶ code ─▶ pnpm install ─▶ D1 migrations ─▶ API Worker ─▶ Admin Worker
Terminal window
pnpm run update -- --branch develop # pull a specific upstream branch (or set UPDATE_BRANCH)
pnpm run update -- --auth # one configuration area per run:
# --auth --email --storage --database --domain --admin-domain
pnpm run update -- --ci # non-interactive configuration

--storage and --database only report current values and explain the manual wrangler.toml edit. --branch applies only to the plain code update.

  • Refuses to run if setup never completed (no database_id).
  • Refuses to redeploy over a Worker of the same name that is bound to a different database.
  • Never regenerates BETTER_AUTH_SECRET, so users stay signed in.

Cloudflare’s edge cache may briefly serve the previous admin index.html. It corrects itself within minutes.

An install scaffolded before the switch to a real Git clone has unrelated history. update detects this, explains it and asks before doing a one-time reconciliation merge. Config in wrangler.toml is preserved.

Read the changelog before updating a production deployment. To update an external Astro site, see Astro deployment.