View Categories

Updating RackHelm

A RackHelm update replaces the application files, brings the database schema up to date, rebuilds the front-end assets and restarts the background worker. The updater, sudo rackhelm-update, runs the whole update for you, in a fixed order. You can also inspect available releases and full release notes inside the admin area under Platform Settings → Updates. An install that predates the updater is updated by hand, following Updating by hand below.

Before you start #

  • Take a full backup. See Backing up and restoring. Migrations change the schema and are not always reversible.
  • Read the release notes for the version you are moving to. A major version number change signals a breaking change to the installer or to an integration contract, or a migration that cannot be rolled back cleanly.
  • Pick a quiet window. Provisioning, payments and invoicing all stop while the worker is down.

Warning: Do not update straight onto a production box you have not backed up. If a migration fails halfway you are left with a partially applied schema, which is far harder to recover from than a restore.

Checking for updates in the admin area #

Open Platform Settings → Updates (/admin/updates) to see whether your licence is offered a newer release, alongside an interactive Release Notes & Changelog accordion parsed directly from CHANGELOG.md. The currently installed release opens by default with a Current Version badge, and clicking any earlier release expands its changes.

The Updates page in the admin area showing the installed version status and the interactive Release Notes and Changelog accordion
Platform Settings → Updates shows whether a new release is available and renders the full release history from CHANGELOG.md.

Updating with rackhelm-update #

The installer puts the updater’s launcher in /usr/local/bin, and every update refreshes it. Run it as root, ideally inside tmux or screen:

sudo rackhelm-update

It downloads the release your licence is offered and verifies it before anything on the live site changes. It then shows a plan, with the installed and new versions and the pending migrations, and asks you to confirm.

What it checks first #

Before it changes anything, the updater checks the server against what the new release needs:

  • PHP (8.3 or newer for 2.2.0+), the ionCube Loader and the PHP extensions.
  • The database server: MySQL 8.0 or later, or MariaDB 10.5 or later.
  • Redis: checks the running Redis version and detects whether a local OS-packaged end-of-life Redis release (such as Ubuntu 24.04’s 7.0.15) needs upgrading to Redis 8.x.
  • Free disk space, and that the new release boots under this PHP.

When PHP or the database server is too old, the updater stops with an explanation before changing anything on the live site; have the server’s administrator upgrade PHP or the database server, then run the updater again. For local OS-packaged end-of-life Redis servers, rackhelm-update automatically adds the official GPG-signed Redis repository (packages.redis.io), backs up the configuration, and upgrades Redis in place to Redis 8.x while maintenance mode is active and Horizon is stopped, preserving your existing redis.conf settings. Remote, Valkey and Docker/source Redis installs are left untouched, and you can opt out with --skip-redis-upgrade or RACKHELM_SKIP_REDIS_UPGRADE=1. If the updater cannot read a database or Redis version (for example behind a proxy), it warns and carries on.

Note: Each update runs its checks with the updater of the release already installed, so the database and Redis check takes effect from the first update after 2.0.3. The update to 2.0.3 itself does not make it.

What it does #

  1. Puts the site into maintenance mode.
  2. Lets the queue workers finish their current job, then stops them.
  3. Dumps the database to /var/www/rackhelm-shared/backups.
  4. Switches to the new release. The previous release stays on disk.
  5. Reloads PHP-FPM.
  6. Applies the database changes with migrate --force (on 2.2.0, aligning the MySQL/MariaDB schema collation to utf8mb4_unicode_ci).
  7. Best-effort installs optional PHP extensions (such as imagick), configures /etc/logrotate.d/rackhelm-horizon with copytruncate and 0664 ownership on horizon.log, applies Nginx/Apache version banner hardening (server_tokens off / ServerTokens Prod and ServerSignature Off) after config-testing, rebuilds the view cache and file permissions, adds the scheduler’s cron entry if missing, and warns when no cron service is running.
  8. Restarts the queue workers. On an install made with an installer older than 2.0.3, it also corrects Horizon’s Supervisor settings first; see Updating to 2.0.3 below.
  9. Checks that the new release responds, then takes the site out of maintenance mode.

Options #

Option What it does
--check Shows the installed and latest versions. Changes nothing.
--status Shows the installed version, the releases on disk and any interrupted run.
--resume Continues an interrupted run from the step it reached, for example after a dropped SSH session.
--rollback Switches back to the previous release. It restores the files only, never the database schema.
--file=PATH Installs from a release archive already on the server instead of downloading it.
--skip-redis-upgrade Skips the automatic in-place upgrade of a local end-of-life OS-packaged Redis server to Redis 8.x (equivalent to setting RACKHELM_SKIP_REDIS_UPGRADE=1).

Updating to 2.0.3 #

  • Database changes. The updater applies them with migrate --force: a new table, software_inventory_runs; two new permissions, View Software Inventory and View System Info; and a new schedule, Collect Software Inventory, enabled and run daily at 04:23 UTC. On an existing install only Super Admin holds the two permissions until you grant them under Users & Roles → Roles & Permissions.
  • Queue workers and cron. The updater restarts the queue workers, which the new application install job and the inventory scan need. The scheduler cron must be running, for the inventory to collect itself and for System Info to see the scheduler’s heartbeat.
  • Software Inventory starts empty. The first inventory appears after the first scan: the night after the upgrade, or sooner if you press Refresh on the page (see Software Inventory).
  • Horizon after a restart. On an install made with an installer older than 2.0.3, Horizon stops for good the first time Supervisor restarts: after a reboot, a Supervisor upgrade or, on Ubuntu, an automatic security update. The update to 2.0.3 corrects this. It sets Horizon to start whenever Supervisor does, and makes the server’s service manager wait for Supervisor to stop Horizon cleanly. If Schedules → Queue Monitor shows No active supervisors found. Is Horizon running? before you update, get the queue moving first:
    sudo supervisorctl start rackhelm-horizon

Updating by hand #

Use these steps only on an install that predates the updater. On such an install rackhelm-update is missing, or stops with No updater found and points you to this guide. Run the steps in this order; the order matters.

1. Put the site into maintenance mode #

cd /var/www/rackhelm
sudo -u www-data php artisan down

Customers see a maintenance page instead of a half-migrated portal.

2. Back up #

mysqldump --single-transaction --routines --triggers rackhelm > /root/rackhelm-pre-update.sql
tar -czf /root/rackhelm-pre-update.tar.gz -C /var/www rackhelm

3. Replace the application files #

Extract the new release over the existing tree, keeping .env, storage/ and the public/storage symlink:

tar -xzf rackhelm-1.1.0.tar.gz -C /var/www/rackhelm --strip-components=1

Then clear the compiled caches that may have travelled inside the archive or been left by the previous build:

rm -f bootstrap/cache/packages.php bootstrap/cache/services.php bootstrap/cache/config.php

Note: Skipping this step is the usual cause of Class Laravel\Pail\PailServiceProvider not found immediately after an update — a manifest generated when development dependencies were present, loaded by a build that no longer has them.

4. Update the PHP dependencies #

composer install --no-dev --optimize-autoloader

5. Rebuild the front end #

npm install
npm run build

Skipping this leaves the browser loading asset files the new templates no longer reference, which usually shows up as an unstyled page or a dead button rather than an error.

6. Run the migrations #

sudo -u www-data php artisan migrate --force

--force is required because the application is in the production environment.

7. Rebuild the view cache #

sudo -u www-data php artisan view:clear
sudo -u www-data php artisan view:cache

Warning: Never run php artisan optimize, route:cache or config:cache on RackHelm. Route caching serialises closure-based routes, and closure serialisation needs PHP source that the ionCube encoder removes — the cached routes then fail at runtime with Call to a member function bindTo() on null. Config caching freezes the licence key, which is read from .env at runtime. View caching is the only one that is safe, because Blade templates ship as plain text.

8. Re-apply permissions #

Extracting an archive as root leaves new files root-owned. Restore the ownership model (use nginx on RHEL):

chown -R root:www-data /var/www/rackhelm
chmod -R u=rwX,g=rX,o= /var/www/rackhelm
chown -R www-data:www-data storage bootstrap/cache
chmod -R u=rwX,g=rX,o= storage bootstrap/cache
chown root:www-data .env
chmod 640 .env

9. Restart the background worker #

sudo -u www-data php artisan horizon:terminate

Horizon holds the code it started with, so without this the queue keeps running the previous build. Supervisor restarts it automatically. Confirm with supervisorctl status rackhelm-horizon.

10. Reload PHP-FPM #

sudo systemctl reload php8.5-fpm

OPcache holds compiled files in memory keyed by path and modification time. A reload guarantees the new code is picked up rather than relying on OPcache noticing.

11. Bring the site back #

sudo -u www-data php artisan up

After the update #

  1. Load the portal front page and sign in to the admin area.
  2. Check the version in the admin sidebar footer matches the release you installed.
  3. Open the Horizon dashboard and confirm workers are running and no jobs are failing.
  4. Open Platform Settings → System Info and clear any checks it raises. It shows whether the scheduler is ticking, whether Horizon is running, any pending migrations and an available update. It needs the View System Info permission, which only Super Admin holds until it is granted.
  5. Grant any new permissions the release adds to the roles that need them, under Users & Roles → Roles & Permissions.
  6. Skim storage/logs/laravel.log for new errors.
  7. Place a small test order end to end if the release touched checkout or provisioning.

If something goes wrong #

The safe rollback is a restore, not a partial undo — a database that has been migrated forward will not work with the previous code. After a manual update, restore the database dump and the file tree from step 2 together, then restart the worker and PHP-FPM. If the failure happened before the migrations ran, restoring the files alone is enough.

With the updater, a run that stops before it switches releases puts the old site back; fix the error and run it again. A run that stops later leaves maintenance mode on: continue with sudo rackhelm-update --resume, or go back with sudo rackhelm-update --rollback. A rollback after the migrations have run leaves the newer schema in place. To revert fully, also restore the dump the updater wrote to /var/www/rackhelm-shared/backups.

Troubleshooting #

Symptom Cause and fix
Class Laravel\Pail\PailServiceProvider not found Stale bootstrap/cache/packages.php. Delete the three cache files and re-run composer install --no-dev.
Call to a member function bindTo() on null Someone ran route:cache or optimize. Run php artisan route:clear and never run those commands again on this platform.
Licence key appears empty after an update config:cache was run and froze the value. Run php artisan config:clear.
Pages render unstyled npm run build was skipped, or public/build is root-owned and unreadable by the web-server user.
Background jobs still show old behaviour Horizon was not restarted. Run php artisan horizon:terminate.
Permission-denied errors writing logs or uploads Step 8 was skipped. storage and bootstrap/cache must be owned by the web-server user.
rackhelm-update stops with … is below this release's minimum … PHP, the database server or Redis is older than the release needs. Nothing was changed. Have the server’s administrator upgrade it, then run the updater again.
Migration fails partway through Stop. Restore the database dump rather than re-running — a partially applied batch is what makes recovery hard.