Campaign Kit docs
v1.1.0
Get help
● Help · Maintenance

Updating
without losing data.

How to move to a new release: back up, replace the code, migrate, rebuild, redeploy.

01Update procedure

On Windows

The commands on this page run in a bash shell on the Linux server (over SSH) or in Terminal on macOS or Linux. From a Windows computer, connect to the server with the ssh command in PowerShell, or run local commands in WSL 2 (Ubuntu) or Git Bash and paste them unchanged.

  1. Read the changelogCheck Changelog for migration notes and new variables.
  2. Back upDatabase dump and .env (see Backups).
  3. Replace the codeCopy the new release over your copy (or merge it if you changed the code). Keep your .env; compare it with the new .env.example for new variables.
  4. Install and check locallypnpm install, then pnpm check (typecheck, lint, format check and tests; see Build, tests & checks).
  5. Deploy the APIdocker compose up -d --build. The image runs new migrations on start.
  6. Rebuild the appspnpm --filter @kit/miniapp build and pnpm --filter @kit/admin build, upload both dist folders.
  7. Check/health shows the new version and "database":"ok", Workspace settings, one Mini App session.

02What never to change during a live campaign

  • ENCRYPTION_KEY (bot tokens), ABUSE_HASH_SALT (anti-bot clusters and puzzle answers).
  • Upgrade card keys and a running season's points-per-XP (fixed by the API anyway).
  • The contract, while a distributor is live: a published snapshot needs its exact contract.

03Local and test databases

pnpm db:migrate
DATABASE_URL=postgres://localhost:5432/campaign_kit_test pnpm db:migrate
DATABASE_URL=postgres://localhost:5432/campaign_kit_e2e pnpm db:migrate