alxpanel-upgrade
Upgrades the alxpanel packages with a snapshot first, checks the server afterwards, and rolls back by itself when the check fails.
The panel's Panel updates page runs this command for you. Run it from a shell when you prefer a terminal, or when the panel is not reachable. Run it as root.
Usage
alxpanel-upgrade run [--no-rollback]
alxpanel-upgrade rollback [SNAPSHOT] [--yes]
alxpanel-upgrade health [--json]
alxpanel-upgrade os-check
Started from a shell, run and rollback move themselves into a systemd unit named alxpanel-upgrade-<job>, so the work continues if your SSH session drops. Output still arrives in your terminal.
run
Upgrades to the newest release in the server's channel.
- Checks, before anything changes. Is there a newer release; is there enough free space under
/var/lib/alxpanelfor a snapshot; does the panel database answer. A customer backup that is running is noted, and the upgrade goes on. A copy of the packages that are installed now is put aside. - New packages.
dnf -y upgrade 'alxpanel*'. - Snapshot, then migration. The panel goes into maintenance, the panel database and
/etc/alxpanelare saved, and only then is the database migrated to the new version. - Health check. The same checks as
alxpanel-upgrade health, below. - On a failed step, the server is rolled back automatically: the old packages come back from the copy, and the database from the snapshot.
Customer sites keep serving during an upgrade; only the panel is in maintenance.
| Option | Meaning |
|---|---|
--no-rollback |
On failure, stop and print the rollback command instead of rolling back. |
| Exit code | Meaning |
|---|---|
| 0 | Upgraded, or already up to date. |
| 1 | Failed. Nothing was changed, or the server was rolled back. |
| 2 | The automatic rollback failed too; the panel stays in maintenance. Also: wrong usage. |
| 3 | Another upgrade or rollback is running. |
rollback
The same as alxpanel-rollback, which has the details.
health
Runs the checks an upgrade ends with, changes nothing, and exits 0 when all pass and 1 when any fails:
- the last database migration succeeded;
- the panel answers on
https://127.0.0.1:8443/admin/login; - the agent answers on its socket;
nginx -tandhttpd -taccept the configuration;- nginx, Apache, MariaDB, the panel's PHP and every account's PHP-FPM are running.
--json prints the result as JSON.
os-check
Looks for pending operating system updates and stores the result for the panel's System updates page. It installs nothing.
Snapshots
Snapshots live in /var/lib/alxpanel/upgrade/snapshots/, one folder each, named by time and version. Each holds the panel database (panel.dump), /etc/alxpanel (etc-alxpanel.tar), the packages of that version (rpms/) and a manifest.json.
The newest 5 are kept. Older ones go first when all snapshots together exceed the size limit set on the Panel updates page (5 GB unless changed); the newest one is never removed.
A plain dnf upgrade 'alxpanel*' also takes a snapshot before the database is migrated, but it does not check the server afterwards and does not roll back by itself.
An interrupted upgrade
Nothing resumes by itself after a reboot or a killed run. The next run or rollback marks the interrupted job as failed and cleans up after it. If the panel was left in maintenance, alxpanel-rollback returns it to the last snapshot.
Where to look
- The log of each run:
/var/lib/alxpanel/upgrade/jobs/<job>/log, also shown on the Panel updates page under History. journalctl -u 'alxpanel-upgrade-*'for the runs,journalctl -u alxpanel-panel-migratefor the snapshot and migrations.
Other subcommands
snapshot, record-installed and finish are called by the packages' own units and scripts during an upgrade. There is no reason to run them by hand.