Upgrade
Summary (web updater, no terminal required for migrations):
- Admin → Diagnostics → "Take Backup" creates a verified checkpoint under
storage/backups/{checkpoint_id}/containing a gzip database dump, a copy of.env, and astorage-data.ziparchive of files understorage/app/(the updater workspace is excluded). - Upload the new release via your host (FTP, cPanel File Manager, or SSH),
or use Admin → Diagnostics → Upload release package to validate and stage
the CodeCanyon zip. When a package is staged, Apply update can publish those
files from the browser. Overwrite application files but do not replace
storage/or.envwhen using host tools. - Admin → Diagnostics → "Apply Update" verifies the checkpoint on disk
and re-verifies any staged zip. It enters maintenance mode, captures a fresh
rollback checkpoint while writes are paused, then replaces application files
when staged, runs
migrate --force, and repeats the probes. A core probe FAIL blocks treating the upgrade as complete. - Verify the booking page and cron beacon.
Rollback: when a staged package update leaves the site in recovery, open
/system/diagnostics while maintenance mode is on and use Restore from checkpoint.
An already-open Admin page may receive a 503 on its next action. Restore brings
back the database, .env, durable storage/ files, and application code
from the verified checkpoint and private code snapshot. Native SQL dumps need the host
mysql or psql client; PHP exporter dumps restore without those tools. See Rollback below.
Migrations from the browser. Step 3 runs from Admin → Diagnostics without SSH. Staged zip upload validates the package; Apply update publishes it and runs migrations. Without a staged package, Apply update runs migrations only and your host must already have the new code. The browser sends the zip in 1 MB requests, so the usual PHP upload limit does not need to exceed the full zip size. When an update fails, use Restore from checkpoint on Diagnostics before attempting manual file copies.
Before you begin
- You are the Operator (the person who bought this licence).
- You have access to the admin panel.
- Read the release notes for the new version — specifically the upgrade-impact line. Most releases are additive and safe; breaking changes are called out explicitly.
Standard upgrade procedure (web updater)
Step 1 — Take a backup (gated)
- Go to Admin → Diagnostics (installed release version is shown on this page).
- Click Take Backup (Filament) or 1 · Create backup checkpoint (fallback
/system/diagnostics). - The app writes a verified checkpoint to
storage/backups/{checkpoint_id}/:db.sql.gz: database dump (gzip).env.bak: copy of your environment filestorage-data.zip: archived durable files fromstorage/app/except the updater workspacemanifest.json: file sizes and SHA-256 hashes used to verify integrity
- Note the checkpoint ID on screen. Apply update refuses to run migrations until the checkpoint on disk passes verification for your session. It captures a second, fresh checkpoint after maintenance starts and uses that checkpoint for recovery.
Shared hosting tip:
storage/backups/is private (outsidepublic/) and is not web-accessible. It is included in your cPanel backup if you run one via the control panel.
Step 2 — Upload the new release package
Option A: Admin Diagnostics (validate and stage zip)
- Download the new release ZIP from CodeCanyon.
- Go to Admin → Diagnostics and use Upload release package. Select the zip and leave the page open while its upload and verification progress is shown.
- When verification succeeds, the staged version appears on screen. Use Apply update (step 3) to publish these files and run migrations, or use Option B to upload via your host and run Apply update for migrations only.
Option B: Shared hosting (no SSH)
- Download the new release ZIP from CodeCanyon.
- Extract it locally. It ships with
vendor/bundled — no Composer step needed on your server. - Upload all files via FTP / cPanel File Manager, overwriting the existing
files. Skip
storage/and.env— those are yours.
Option C: VPS / SSH
cd /var/www/calbok
php artisan down --retry=60
# replace files (git pull, or extract the ZIP)
php artisan up
--messagewas removed fromartisan downin modern Laravel — maintenance mode now renders a fixed default page (or your own view via--render=view.name).--retry=60sets theRetry-Afterheader so well-behaved clients back off instead of hammering the site while you upgrade.
Step 3: Apply update (web updater)
- Return to Admin → Diagnostics.
- Click Apply Update (Filament) or 2 · Apply update (fallback).
- The updater re-verifies your checkpoint on disk and enters maintenance
mode. It captures and verifies a fresh rollback checkpoint before changing
code or database schema. When a release zip is staged, it copies the package
to a private immutable file and replaces application files (not
.envor customerstorage/app/). It then runsphp artisan migrate --force. A nonzero migration exit code is treated as failure. The site stays in maintenance and Diagnostics shows a recovery state instead of success. - If file replacement fails before migrations start, Calbok restores the prior application files from a private code snapshot when that snapshot is complete. If restoration cannot be verified, the site stays in maintenance and Diagnostics remains available to authenticated Operators for recovery.
- After migrations complete, all capability probes re-run automatically.
- If a core probe FAILS (PHP version, database queue/limiter backing stores, timezone tables), the updater stays in an error state — do not mark the upgrade complete; proceed to rollback.
- If only optional integration probes fail (mail, SMS, payment gateways, billing provider, etc.), the updater still completes; fix those warnings on Diagnostics when you are ready.
- If all probes are OK or WARN, the upgrade is complete.
Step 4 — Verify
- Check that the admin panel loads normally.
- Run a test booking end-to-end (or at least open the booking page for a tenant and confirm it renders).
- Confirm the cron beacon probe on the Diagnostics page is green (i.e.
schedule:runfired within the last tick window).
Rollback
If Step 3 fails, or if you discover a regression after the upgrade:
Option A — Restore from backup checkpoint (recommended)
- Locate your checkpoint in
storage/backups/{checkpoint_id}/. - Restore the database (plain SQL inside gzip, including
INSERTdata rows; safe for CLI import):
When native# MySQL / MariaDB gunzip -c db.sql.gz | mysql -u USER -p DATABASE # PostgreSQL gunzip -c db.sql.gz | psql -v ON_ERROR_STOP=1 -U USER -d DATABASEmysqldump/pg_dumpare unavailable, the app uses a PHP exporter that writes the same kind of plain SQL (notCOPY ... FROM stdin). Use these pipe commands rather than pasting into a single-statement SQL client. - Restore
.env: copy.env.bakfrom the checkpoint directory back to{root}/.env. - Restore durable files: extract
storage-data.zipinto yourstorage/directory (merge/overwrite as needed). - Restore the old code: re-upload the previous release package (or
git checkoutthe previous tag on a VPS). - Run
php artisan config:clear && php artisan cache:clear. - Verify the Diagnostics page shows green.
Browser recovery (recommended after a failed Apply update):
- Open
/system/diagnosticsas Operator while maintenance is on. Sign in if prompted. - Confirm the recovery banner and click Restore from checkpoint.
- Type the installed release version and the failed update target version shown on screen.
- The app verifies the checkpoint, restores database and storage, restores
.env, restores prior code from the required private snapshot, clears compiled caches, and re-runs core probes. Success exits maintenance mode.
Limits: checkpoints created with native mysqldump / pg_dump require the matching
mysql or psql client on the server. PHP exporter dumps restore without those binaries.
If recovery cannot verify a dump format or snapshot, it stops before destructive steps.
One-click code recovery requires a release staged and applied from Diagnostics.
If you uploaded code using host tools, restore that code using the previous package.
Manual rollback (same checkpoint files under storage/backups/{checkpoint_id}/):
- Import
db.sql.gzwith your host tools (see commands in the HTML upgrade guide). - Copy
.env.bakto.env. - Extract
storage-data.zipintostorage/. - Re-upload the previous release package if code was changed outside the snapshot.
Option B — cPanel backup (shared hosting)
If you do not have a storage/backups/ checkpoint (e.g. the backup step was
skipped or the backup failed), restore from your most recent cPanel full-
account backup via cPanel → Backups → Restore.
Always take a backup before upgrading. Apply update verifies the checkpoint on disk and refuses to run migrations when verification fails.
Migration safety contract (normative)
Every Calbok release migration follows these rules — enforced by the release build pipeline:
| Rule | Detail |
|---|---|
| Tenant isolation preserved | Every migration that touches tenant-owned tables keeps the WHERE tenant_id predicate and all global scopes intact. |
| Clinical data boundary | Migrations cannot add clinical or insurance fields beyond the product's allowed scheduling/contact columns. The release build checks this automatically. |
| Additive by default | New columns are added with a default; nothing is dropped without a data-migration step. In-flight rows (pending bookings, queued notifications, payment authorized rows) survive. |
| Dual-dialect | Every migration runs on MySQL 8 AND PostgreSQL without modification. |
Emergency contacts
- CodeCanyon support: the item page → "Support" tab.
- Documentation:
docs/in this package, or your buyer dashboard. - Cron not firing? See
docs/deployment/shared-hosting.md→ "The single cron entry."