Auto-Updates

Let Pubvana update itself and its extensions automatically every day.

TL;DR

Go to Admin → Updates → Settings: enable Auto-Update, set Check Method to Cron Job, and add the crontab line. Pubvana will check for updates daily and apply them automatically if no breaking changes are detected. Toggle auto-update per extension on the Addons tab.

Details

The Daily Update Chain

When the pubvana-update-chain task fires (once per 24 hours, cache-gated), UpdateService::checkAndAutoUpdateIfDue() runs the following sequence:

  1. CMS update check — fetches CHANGES.json from GitHub and compares the latest version against the installed APP_VERSION.
  2. Safety gate — if the changelog contains breaking changes for the new version, auto-update is skipped and an admin notification is shown instead. Manual review is required.
  3. Pre-update backup — a full site backup (files + DB dump) is created in writable/backups/ before any files are touched.
  4. Download and extract — the release zip is downloaded from GitHub and extracted to writable/updates/.
  5. Apply files — updated files are copied over the existing installation. Config files (.env, App.php, Database.php) are preserved.
  6. Run migrationsphp spark migrate is run to apply any new database migrations.
  7. Clear cache — all caches are flushed.
  8. Extension update check — all installed themes, widgets, and plugins are checked for updates via their update_url endpoints.
  9. Extension auto-update — extensions with auto_update = 1 are updated automatically, subject to compatibility checks.

Safety Features

  • Breaking changes detection: if CHANGES.json flags a version as containing breaking changes, auto-update is skipped entirely. You will see a notification in the admin dashboard.
  • Localhost/dev bypass: auto-updates are skipped on localhost and known development domains. Updates are applied only in production environments.
  • Backup before every update: a timestamped backup is always created before any CMS update, giving you a restore point if something goes wrong.
  • Extension compatibility: each extension declares min_pubvana_version and max_pubvana_version. Extensions outside these bounds are skipped during auto-update.
  • 24-hour cache gate: even if cron minute runs every minute, the update chain only executes once per day.

Manual Updates

If auto-update is disabled, Pubvana still runs the daily check and displays a notification badge in the admin header when a new version is available. You can then apply the update manually from Admin → Updates with a single click.

Checking Extension Auto-Update Status

Visit Admin → Updates → Addons. Each installed theme, widget, and plugin is listed with its current version, latest available version, and an auto-update toggle. Flip the toggle to enable or disable automatic updates per extension.