Updates & backups

Under an annual license, Code 44 delivers a new versioned install archive (for example coaptive-cms-0.7.6.tar.gz) plus an updated signed license when features change. Coaptive product code is not updated from public Packagist. Control Panel → Tools → Updates shows installed CMS/GME package versions and a safe-apply checklist. It does not download updates from the browser — but from 0.7.0 it can apply a staged archive you place in the trusted inbox (storage/app/private/updates/) or via php artisan cms:update-apply on the server.

The supported apply path is on the server: stage the new tree, preserve live data, swap, migrate, and clear caches. Release archives include deploy/UPDATE.md with the same runbook.

What to preserve

  • .env — app key, database, mail, license path, site id, optional GOOGLE_MAPS_API_KEY, backup/S3/Azure keys

  • content/ — pages, forms, branding, theme, styling, navigation

  • storage/ — logs, private uploads, encrypted mail/CAPTCHA settings, license file

  • database/ — SQLite file when using the default DB (external MySQL/Postgres needs only a DB backup)

  • public/assets/ — required. Brand logos and Asset Library files (/assets/brand/…, /assets/library/…). The archive only ships starter/sample files; skipping this merge breaks site images. Merge with rsync -a onto the staged tree.

Do not copy an old public/storage symlink — recreate it after the swap so it points at the new app root.

Update process

  1. Confirm target. App root (directory that contains artisan), current package version in packages/coaptive/cms/composer.json / vendor/code44/coaptive-cms/composer.json, and the PHP-FPM pool user.

  2. Maintenance. As the FPM user (not root): php artisan down --retry=60.

  3. Stage. Extract coaptive-cms-VERSION.tar.gz to a staging directory (top-level folder matches the archive name). Archives already include vendor/, a mirrored code44/coaptive-cms package, and built public/build/ assets.

  4. Preserve. Copy live .env, storage/, content/, and database/ into the new tree (replace the archive defaults). Merge public/assets/ with rsync. Place a new license only if Code 44 issued one.

  5. Swap. Move the live app to a dated backup path, then move the staged tree into the live app root.

  6. Permissions & storage link. Run bash deploy/harden-permissions.sh. Recreate public/storage with php artisan storage:link (or ln -sfn …/storage/app/public …/public/storage if permission denied).

  7. Migrate & caches. Still as the FPM user: migrate --force, optimize:clear, then config:cache / route:cache / view:cache. Do not cache views as root — root-owned Blade cache causes 500s under PHP-FPM.

  8. Up & verify. php artisan up. Confirm package/vendor versions on Tools → Updates and the CP Overview, homepage HTTP 200, /cp login, and a known /assets/… image returns 200.

Backup / Export

Tools → Backup / Export (Administrators) provides:

  • Manual download — .tar.gz or .zip of site content (and optional SQLite DB + private settings JSON).

  • Scheduled off-site backup — daily/weekly upload to S3-compatible storage (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_DEFAULT_REGION, AWS_BUCKET) or Azure Blob (AZURE_STORAGE_CONNECTION_STRING, AZURE_STORAGE_CONTAINER). Retention count prunes older archives.

  • Import / restore — upload a prior export archive to replace marketing/content data (use with care; documented scope in the CP).

Scheduled backups run via cms:backup-export (cron). Failures are logged; configure mail in Tools → Email for alerts.

Common pitfalls

  • 404 under /assets/… — forgot to merge live public/assets/; restore from the pre-swap backup with rsync.

  • 404 under /storage/… — missing or stale public/storage symlink; recreate after swap.

  • 500 after update — often root-owned view cache; clear/chown as the FPM user.

Rollback

Move the failed tree aside and restore the dated backup, then php artisan optimize:clear and up as the FPM user. Delete old backups only when you no longer need them.

Optional rebuild

composer install --no-dev --optimize-autoloader and npm ci && npm run build only if you customize dependencies or frontend assets after unpack.

See How you receive the software and Install. Full command placeholders ship in the archive as deploy/UPDATE.md.