Upgrading

Panel and agent upgrade runbook.

Upgrading Modern Control

Short runbook for moving an existing installation to a newer release. Pair with DEPLOYMENT.md for first-time topology.

Before you upgrade

  1. Note dashboard version (dashboard/package.json) and agent folder (kit-addons/modern_darkrp_control).
  2. Confirm backups: PostgreSQL dump + copy of garrysmod/data/modern_darkrp_control/config.json (contains the live agent secret after pairing).
  3. Schedule a short maintenance window if the game server must restart for the addon.

Dashboard (panel)

  1. Pull or unpack the new release on the panel host.
  2. Install dependencies: cd dashboard && npm ci.
  3. Apply schema: npx prisma migrate deploy.
  4. Build: npm run build.
  5. Restart the process (systemctl restart moderndarkrp-dashboard or equivalent).
  6. Check GET /api/health and GET /api/health/ready → 200.
  7. Log in and confirm Servers shows the expected ONLINE/DEGRADED badge.

Game agent (GMod)

  1. Stop or changelevel the game server only when ready — Lua addons do not hot-reload.
  2. Replace garrysmod/addons/modern_darkrp_control with the release copy. Do not delete garrysmod/data/modern_darkrp_control/config.json unless you intend to re-pair.
  3. Start the game server (or changelevel).
  4. In console: mdrp_status — expect a matching agent version and a recent successful heartbeat.
  5. In the dashboard: Overview / Tactical Map / Commands should refresh within ~10–15s.

Re-pairing (only if credentials are lost)

  1. Owner: Servers → Reissue pairing (or license host transfer).
  2. Paste the new pairing configJson onto the game host.
  3. Restart GMod; wait for ONLINE. Do not keep an old secret alongside a new pairingToken.

Rollback

  1. Redeploy the previous dashboard build and run npx prisma migrate deploy only if that release’s migrations are compatible (never invent reverse migrations).
  2. Restore the previous addon folder; keep the same config.json if the secret was not rotated during the upgrade.
  3. Verify health and heartbeat as above.

Compatibility notes

  • Panel and agent in the same release train are supported; mixed major versions are not.
  • Secret rotation uses an overlap window — finish updating config.json before the previous secret expires.
  • Demo / mock dashboard mode never substitutes for a live paired agent after upgrade.