Upgrading
How to upgrade the MoorCP Shared panel and agents to a new release: upgrading from the panel, the upgrade command on a server, the right order, channels and versions, and update notifications in the panel.
Two ways to upgrade
| Way | When to use it |
|---|---|
| From the panel (Settings › Updates or the banner) | The usual way. One click upgrades the panel, then the agents on all servers |
The upgrade command on each server | Panels installed before v0.9.0-rc.22, servers the panel cannot reach, or when an upgrade from the panel failed |
Customer sites, email, and databases keep running during an upgrade. Only the moorcp-shared and moorcp-agent services are restarted.
Upgrading from the panel
When a new release is out, the banner MoorCP vX.Y.Z is available appears at the top of every admin page, with the installed version and its channel.
- Click Upgrade in the banner, or open Settings › Updates and click Upgrade to vX.Y.Z.
- The confirmation window explains what will happen. Leave Then upgrade the agents on all servers ticked so the agents are upgraded too.
- Click Upgrade now.
The banner changes to Upgrading MoorCP to vX.Y.Z…. The admin and client panels are unavailable for about a minute, then the page reconnects by itself.
Click Later to hide the banner for that version in that browser. The panel never upgrades without an admin's click.
INFO
Only admins can start an upgrade.
What happens on the panel server
The panel runs as the user moorcp without root privileges, so it does not replace itself:
- The panel writes an upgrade request.
- The systemd unit
moorcp-shared-upgrade.path(root) sees the request and runsmoorcp-shared self-upgrade. self-upgradeverifies the signatures of the release list andSHA256SUMS, and the checksum of that release'sinstall.sh. A version that is not newer, or is not in the signed release list, is refused. The channel and mirror come from/etc/moorcp-shared/release, not from the panel's request.- The installer runs in upgrade mode. The steps are the same as the
upgradecommand below, including database migrations. - The panel restarts with the new version. About 45 seconds later, the agent upgrade starts if you chose it.
The status and the last 40 lines of the installer log are shown in Settings › Updates, under Last upgrade from the panel. If the upgrade fails, the banner Upgrade to vX.Y.Z failed is shown for 24 hours with the error message.
WARNING
The moorcp-shared-upgrade.path unit is installed by the installer from v0.9.0-rc.22 on. Older panels need one upgrade with the upgrade command. Until then, the Upgrade button shows that command.
Upgrading agents
Agents can be upgraded from the panel without logging in to each server:
- automatically after a panel upgrade, if the agent option is ticked;
- the Upgrade agents button in the banner, when some servers run an agent older than the panel;
- the Upgrade N agents button on the Servers card in Settings › Updates, or Upgrade for a single server.
For each server:
- The agent downloads the agent binary from the panel. The installer put that binary on the panel from the same release as the panel.
- The checksum is compared, and the new binary must report the requested version before it replaces the old one.
- The new version is recorded in
/etc/moorcp-shared/release, then the agent restarts itself. - The panel waits for a heartbeat with the new version, for up to 3 minutes.
One server is upgraded first as a trial. If it fails, the other servers are not tried (status Stopped: first server failed). If it succeeds, the rest run in parallel, three at a time. Servers that are offline or not enrolled yet are skipped.
INFO
Agents older than v0.9.0-rc.22 cannot be upgraded from the panel yet. Run the upgrade command once on that server. The status of the last rollout is kept in the panel's memory and is lost when the panel restarts.
Upgrade command
Run it on the panel server or a hosting server:
curl -fsSL https://get-shared.moorcp.com | sudo bash -s -- upgradeThe installer detects what is installed on that server (panel, agent, or both) and only updates what is there.
- A panel that is turned off (unit
moorcp-shareddisabled and not running), for example after the panel moved to another server, is skipped with a warning. Only the agent is upgraded. - A panel that is running but whose unit is not enabled is still upgraded, and its unit is enabled so it starts again after a reboot.
Order
- Upgrade the panel first, from the panel or with
upgradeon the panel server. - Then the agent on every server, from the panel or with
upgradeon each server.
An upgrade from the panel with the agent option ticked already follows this order. On an all-in-one install, one upgrade updates the panel and the agent together.
What the upgrade does
The upgrade uses the channel and mirror recorded at install time in /etc/moorcp-shared/release. If the version is already the latest, the installer prints Already on vX.Y.Z (channel ...) and does nothing (unless you switch channels, see Channels and versions).
If there is a new version (Upgrade vA → vB):
| On the panel server | On a hosting server |
|---|---|
The moorcp-shared and moorctl binaries and the admin panel are replaced | The moorcp-agent binary is replaced |
| The agent downloads on the panel are updated | The moorcp-agent service is restarted |
The moorcp-shared-upgrade.path unit is installed or updated | |
New settings are added to /etc/moorcp-shared/env if needed | |
| Database migrations run | |
The moorcp-shared service is restarted, then the health check must pass |
Finally, the new version is recorded in /etc/moorcp-shared/release and the installer prints Done: vX.Y.Z.
Channels and versions
| Channel | Contents |
|---|---|
stable | Final releases (vX.Y.Z) |
rc | Release candidates (vX.Y.Z-rc.N) and also final releases; always points to the latest release |
The installer uses stable by default. The first stable release was v0.9.0; the latest at the time of writing is v0.12.5. Use the rc channel only if you want to try release candidates before they become stable.
Messages in English
From v0.9.0-rc.25, the installer prints its messages in English. Older installers printed them in Indonesian. Message details are in Installation problems.
Switching channels
The channel is recorded in /etc/moorcp-shared/release and used by every later upgrade, from the command line and from the panel. To switch, run upgrade with --channel on the server:
curl -fsSL https://get-shared.moorcp.com | sudo bash -s -- upgrade --channel stablecurl -fsSL https://get-shared.moorcp.com | sudo bash -s -- upgrade --channel rcThe new channel is recorded even when the installed version is already the latest in it. The installer then prints Already on vX.Y.Z; channel changed to stable and restarts the panel, so Settings › Updates shows the new channel. The panel itself has no channel switch.
Older installs move to stable
Before v0.9.0 there was no stable release, so every install used --channel rc. On the next upgrade (from the command line or from the panel), a server whose release file still records rc from that time is moved to stable once. The installer prints:
Channel rc was recorded before stable releases existed; moving this server to the stable channel (run upgrade --channel rc to stay on release candidates)To stay on release candidates, run upgrade --channel rc on the server yourself. That choice is recorded and is not changed again.
A specific version
curl -fsSL https://get-shared.moorcp.com | sudo bash -s -- upgrade --version vX.Y.ZReplace vX.Y.Z with the version you want. Upgrades from the panel always use the recorded channel and only offer newer versions.
WARNING
The upgrade refuses a version older than the installed one, with the message version ... is older than the installed one (...); use --allow-downgrade if this is intended. Add --allow-downgrade only if you really want to downgrade, for example when support asks you to.
Update notifications in the panel
The update overview is in Settings › Updates:
| Section | Contents |
|---|---|
| MoorCP release | Installed version, Latest release, channel, last check time, the upgrade button, and the status of the last upgrade |
| Servers | Agent version of each server (Up to date / Outdated), OS updates, reboot needs, and agent upgrade status |
- The panel checks for releases 1 minute after it starts, then every 30 minutes. Click Check now to check right away.
- The ed25519 signature of the release list is verified with the key built into the panel, the same as the installer's. A list without a valid signature is refused.
- Agents check for OS package updates every 6 hours, and also right after you run
dnf upgradeyourself.
These conditions also show up as alerts and are sent to your notification channels:
| Alert | When it appears |
|---|---|
panel_update_available | The panel's channel has a release newer than the installed version |
agent_outdated | A server's agent version is older than the panel version |
os_security_updates | A server has packages with security updates |
reboot_required | The kernel or core libraries were updated, but the server has not rebooted |
Alerts close by themselves once the upgrade or reboot is done. On a server's detail page, the same conditions show as a banner above the tabs, with the command to run.
OS updates
OS package updates are not installed automatically, and not from the panel either. To install only security updates on a server:
dnf upgrade --securityConfiguring the checks
Add these to /etc/moorcp-shared/env on the panel server, then restart moorcp-shared:
| Variable | Effect |
|---|---|
MOORCP_UPDATE_CHANNEL=stable|rc | Overrides the channel that is checked |
MOORCP_RELEASES_URL=URL | Overrides the release mirror |
MOORCP_UPDATE_CHECK=off | Turns the checks off, for example on servers without internet access |
A panel with a custom build (a version that is not vX.Y.Z) is not compared with releases and shows as Custom build. Such a panel is upgraded the same way it was installed, not from the panel.
