Upgrading and uninstalling
Moving to a new release and back again, and taking Moorage away.
On this page
Back up#
moor server backup --to /mnt/backupsThat holds the database, repositories, builds, apps' data, certificates and a dump of each service of production and the named environments, and the server goes on running. Keep keys/master.key safe, and apart from your backups: it encrypts the apps' secrets, and a backup leaves it out. See backups for a schedule, buckets and restoring.
Upgrading#
From 0.6.0, a server upgrades itself. To get to 0.6.0 from an earlier version, run the installer once, and restart the server.
Before you do:
- Read what will be different. The changelog has a list of things to know under each release. Read the list of each one that you are crossing, and you need not stop at any of them: CI upgrades from the last release and from 0.6.0, with apps running.
- Start the server, if it has stopped, with
moor server start.moor server statussays. An upgrade only goes back by itself if the server was running, as there is otherwise nothing to restart: it replaces the binary, and nothing is watching when you start it. - Make a backup, if what it holds matters. An upgrade keeps a copy of the database, for going back, and no more than that.
moor server upgrade --checksudo moor server upgradeLeave out the sudo if you installed the service without it, as the service is then your own. Use the moor that the service runs: moor server upgrade says so if this is another.
That downloads the newest release and checks it against the checksum published with it. It then keeps a copy of the database, in upgrades in the data directory, and of the binary, as moor.previous beside it, puts the new binary in place, and restarts the server. Running apps keep running, and the new server takes them over. If the server does not come up on the new version, everything goes back by itself. A database from a large server can take a while to migrate: --wait 10m gives it longer than the 2 minutes it otherwise has.
| Option | What it does |
|---|---|
--check | Only says whether there is a newer version |
--version 0.6.1 | Upgrades to that version, and not the newest |
--from DIR | Takes the release from a directory or an address, for a mirror or a machine with no way out. It holds a release's files |
--wait 10m | Gives the new version longer to come up |
To go back later:
sudo moor server upgrade --rollbackThat puts back the binary, and leaves the database alone if the new version did not change it. If it did, the previous version could not read it, so it goes back to its copy from before the upgrade. What has happened since is then lost from it, so after 10 minutes this takes --force, and what it replaced is kept beside the copy, in upgrades in the data directory. There is one way back: from the last upgrade.
A server that nothing manages, run with moor server run, gets its new binary, and goes on with the version it started with until you restart it. To go back, stop it first.
To see that all is well afterwards, with sudo for a system service:
moor server doctormoor appsUpgrade moor on the other machines that use the server too, by running the installer again: a newer server may change what the API answers.
A server from before 0.1.0 has no accounts yet: moor server status shows the link to create the first, and until then the admin token works from anywhere, as it did.
With the installer#
The installer can upgrade a server as well, without the copies or the way back. Run it again as the same user, which replaces moor where it is and says what it upgraded from, and restart the server:
sudo moor server restartUntil you do, a server goes on with the version it started with. A newer server changes the database as it starts, after keeping a copy in backups in the data directory, and an older one refuses a database that has moved on. So to go back to an earlier version in this way: stop the server, put that copy in the place of moorage.db, and give the installer the version with MOOR_VERSION. moor server upgrade --rollback only goes back from the version it upgraded to, and says so if the installer has been at work since.
On Windows, the server and the supervisors of its apps run from moor.exe, and a running program cannot be replaced there, so both ways move it aside, where it goes on running. A server run in a terminal needs Ctrl+C and starting again.
What a release can be checked against#
Each release has SHA256SUMS, a list of what went into the binaries in moorage-sbom.cdx.json, and an attestation of the workflow that built them. An upgrade and the installer both check a download against SHA256SUMS, which comes from the same place over HTTPS. That catches a damaged download, and a change on the way, and would not catch someone who could change the release itself. The attestation is GitHub's own record of what its build made, and that you can look at yourself:
gh attestation verify moor-linux-amd64 --repo robert-mcdermott/moorageUninstalling#
First, if your apps have services: what they hold is in volumes in the container engine, and uninstalling the server leaves those there. While the server still runs, deleting an app takes its services with it, and moor services remove takes one on its own:
moor apps delete shopIf you have already gone further than that, your engine still lists them, and podman volume rm takes one. This is for Podman, and Docker takes the same:
podman volume ls --filter label=io.moorage.managed=trueIf you changed what a computer trusts or resolves, take that back, on each one where you did:
moor trust --removemoor server resolver removeThen stop the server, its apps and their services, and remove the service:
sudo moor server uninstallThen delete the program: ~/.local/bin/moor or /usr/local/bin/moor, with moor.previous beside it if it has upgraded itself. On Windows, that is the %LocalAppData%\Programs\Moorage folder, whose entry you can also remove from your user PATH (Settings → System → About → Advanced system settings → Environment Variables), and the %ProgramFiles%\Moorage folder, where installing the service puts a copy.
The configuration and the data stay. Delete server.toml, which moor server status names, and the data directory that it names under data_dir, only if you no longer need the apps' data and the keys in it. A server set up as yourself has both in one folder, ~/.moorage, or %LocalAppData%\Moorage on Windows. What moor itself remembers of the servers it signs in to is in config.toml in ~/.moorage, or in %AppData%\moorage on Windows.