Upgrades and operations
Preserve service identity, back up metadata and verify releases.
Upgrade procedure
- Read release notes for configuration and migration changes.
- Back up D1 and retain the Worker name, D1 ID, domain and variables.
- Update source and dependencies, then run checks, tests and the Web build.
- Deploy with the existing configuration and verify health, config, pairing and session reads.
git pull --ff-only
pnpm install --frozen-lockfile
pnpm check
pnpm test
pnpm build:web
pnpm run deployPreserve your SITE_URL build variable if using a public custom domain.
Backups
pnpm exec wrangler d1 export DB --remote --output ./reignhub-backup.sqlKeep backups private and out of Git. D1 contains device metadata, credential hashes, pairing records and service signing identity even though it stores no plaintext chats.
Recreating the database changes service identity and affects directories and short-lived leases. Do not clear it to fix routine connectivity issues. Controller-side local session caches are not included in a D1 backup.
Verify deployment
View version and domain status in the Cloudflare dashboard, or use the CLI:
pnpm exec wrangler deployments list
pnpm exec wrangler versions listAfter deploying, check /healthz and /p2p/config, then connect to a device through /chat. If an upgrade fails, roll back to a working version in the Cloudflare dashboard.
Monitoring and cost
Watch Worker/DO requests, CPU, WebSocket counts, D1 reads/writes and storage, and optional probe traffic. Relaying application data has a different load profile from signaling. Configure budget alerts for your Cloudflare plan.