---
title: Updates and rollback | Space Works Organization docs
description: How a bundled install moves to a new release, what the updater checks on the way, and what a rollback can and cannot undo.
url: https://spaceworkslabs.tech/docs/organization/guides-hosting-updates-and-rollback/
updated: 2026-11-21
---

[Space Works Organization](https://spaceworkslabs.tech/docs/organization/) Start here
- [Overview](https://spaceworkslabs.tech/docs/organization/overview/)
- [Glossary](https://spaceworkslabs.tech/docs/organization/guides-start-glossary/)
- [Quickstart for members](https://spaceworkslabs.tech/docs/organization/guides-start-quickstart-member/)
- [Quickstart for organisation owners](https://spaceworkslabs.tech/docs/organization/guides-start-quickstart-owner/)
- [Quickstart for platform operators](https://spaceworkslabs.tech/docs/organization/guides-start-quickstart-operator/)
Features
- [Certificates](https://spaceworkslabs.tech/docs/organization/features-certificates/)
- [Groupings](https://spaceworkslabs.tech/docs/organization/features-groupings/)
- [Member cards](https://spaceworkslabs.tech/docs/organization/features-member-cards/)
- [Member portal](https://spaceworkslabs.tech/docs/organization/features-member-portal/)
- [Notifications](https://spaceworkslabs.tech/docs/organization/features-notifications/)
- [Organisations](https://spaceworkslabs.tech/docs/organization/features-organisations/)
- [Payments](https://spaceworkslabs.tech/docs/organization/features-payments/)
- [Plans and join forms](https://spaceworkslabs.tech/docs/organization/features-plans-and-join-forms/)
- [Public page](https://spaceworkslabs.tech/docs/organization/features-public-page/)
- [Receipts and refunds](https://spaceworkslabs.tech/docs/organization/features-receipts-and-refunds/)
- [Renewals](https://spaceworkslabs.tech/docs/organization/features-renewals/)
- [Reports and analytics](https://spaceworkslabs.tech/docs/organization/features-reports-and-analytics/)
- [Self-hosting](https://spaceworkslabs.tech/docs/organization/features-self-hosting/)
- [Sign-in](https://spaceworkslabs.tech/docs/organization/features-sign-in/)
- [Staff and roles](https://spaceworkslabs.tech/docs/organization/features-staff-and-roles/)
- [Units](https://spaceworkslabs.tech/docs/organization/features-units/)
- [Web analytics](https://spaceworkslabs.tech/docs/organization/features-web-analytics/)
- [Payments](https://spaceworkslabs.tech/docs/organization/payments/)
- [Tax on membership payments](https://spaceworkslabs.tech/docs/organization/gst/)
- [Reports](https://spaceworkslabs.tech/docs/organization/reports/)
- [Email and chat notifications](https://spaceworkslabs.tech/docs/organization/notifications/)
Install and run
- [Backups and restore](https://spaceworkslabs.tech/docs/organization/guides-hosting-backups-and-restore/)
- [Choose your hosting](https://spaceworkslabs.tech/docs/organization/guides-hosting-choose-your-hosting/)
- [Monitoring and health](https://spaceworkslabs.tech/docs/organization/guides-hosting-monitoring-and-health/)
- [Updates and rollback](https://spaceworkslabs.tech/docs/organization/guides-hosting-updates-and-rollback/)
- [Deploying on a server (VPS)](https://spaceworkslabs.tech/docs/organization/deployment-vps/)
- [Deploying with managed services (cloud)](https://spaceworkslabs.tech/docs/organization/deployment-cloud/)
- [Free hosting behind Cloudflare](https://spaceworkslabs.tech/docs/organization/deployment-cloudflare/)
- [Hosting the site on Netlify](https://spaceworkslabs.tech/docs/organization/deployment-netlify/)
- [Configuration reference](https://spaceworkslabs.tech/docs/organization/configuration/)
[All docs](https://spaceworkslabs.tech/docs/)

Space Works Organization · Install and run

# Updates and rollback

How a bundled install moves to a new release, what the updater checks on the way, and what a rollback can and cannot undo.

## Releases and tags

Releases are published from`main`and titled`Space Works Organization <version>`. The root`VERSION`file selects the series, and each build is tagged`v<series>-main.<run>.<sha>`, for example`v0.9.0-main.42.a1b2c3d4e5f6`(the SHA is 12 lowercase hex characters). That tag is what a deployment pins to. Pushes to`dev`publish staging images tagged`dev`without a release, and the updater never installs them.

The installed release is recorded in`.spaceworks-version`, and the one before it in`.spaceworks-previous-version`. The compose wrapper pins every command to`.spaceworks-version`, so images never change under you between updates. What changed in each release is in the[changelog](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization/blob/7cd1441838559f323c26e5ddbab0e72181b4bc4d/CHANGELOG.md) .

## Update `bash scripts/update.sh --force # newest main release bash scripts/update.sh --force --version 0.9.0-main.42.a1b2c3d4e5f6`

This is menu option 1 of the installer.`--version`takes the tag without its leading`v`. Only published, non-prerelease`main`releases of the configured repository are accepted. If the release is already installed, the updater says so and stops.

### What the updater does
- **Takes the lock.**A directory lock (`.spaceworks-update.lock`) stops two updates at once, and with`flock`an operation lock also stops a backup or restore running at the same time.
- **Finds the release**on GitHub and downloads its source into temporary storage.
- **Hands over.**The new release's own`scripts/update.sh`does the rest, so every update runs the target release's updater and host files.
- **Dumps the database**to`backups/pre-update-<time>.sql.gz`. If the dump is empty, the update is cancelled.
- **Checks the new backend image can be pulled**before any host file changes.
- **Installs the host files**listed in[`scripts/install-host-bundle.sh`](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization/blob/7cd1441838559f323c26e5ddbab0e72181b4bc4d/scripts/install-host-bundle.sh) (compose files,`deploy/`, the setup and operations scripts), keeping each replaced file in`backups/host-config-<time>-<pid>/`. An archive missing any listed file is refused before anything is replaced.
- **Pulls the images**, then starts the stack. The`migrate`service runs`prisma migrate deploy`once as the schema owner before the app starts; the app never starts on a half-migrated database.
- **Waits up to five minutes**for every service to be healthy, then runs the operator checks (the`ops`role).
- **Records the versions**and removes`pre-update`dumps older than 14 days and`host-config`folders older than 30.

### If an update fails

| Where it stops | What happens |
| --- | --- |
| Before the host files change (download, dump, image check) | Nothing is replaced; the running release carries on. |
| After the host files change, before deployment | The previous host files come back. |
| During deployment (unhealthy services or failed checks) | Automatic rollback: the previous host files and images come back, started with`--no-deps`so older migrations never run against the newer schema. The pre-update dump is kept. |

If the automatic rollback itself fails, the updater says so: restore the pre-update dump with`scripts/restore.sh`and start the previous image tag by hand.

### A stuck lock

A lock left by a process that has died is recovered automatically. If the lock's process is still alive, or the lock has no readable owner, the updater refuses. Check that no update is running, then: `bash scripts/update.sh --force --override-lock`

## Roll back `bash scripts/update.sh --force --rollback`

This is menu option 3. It returns to the release in`.spaceworks-previous-version`, replacing only the application containers (`backend`,`worker`,`beat`and Caddy when present). It never runs migrations.`--version`and`--rollback`cannot be used together.

### What a rollback can and can't undo

| Undone | Not undone |
| --- | --- |
| The application images | Database changes: new tables, columns and data written since the update stay |
| The host files (compose files, scripts,`deploy/`) | Emails and chat alerts already sent |
| Background-job containers the older release does not define (removed afterwards) | Payments settled with gateways in the meantime |

The previous release keeps working against the newer schema because migrations are written for it. For example, migration`0017_rollback_safety`adds triggers that fill in the custom role and unit code the previous release does not know about, and the old fixed role columns are still written for the same reason. These columns and triggers go in a later release.

**Warning:**To return the data as well, restore the pre-update dump the rollback prints, for example`bash scripts/restore.sh backups/pre-update-20261119T101500Z.sql.gz`. Anything written since the update is lost. See[Backups and restore](https://spaceworkslabs.tech/docs/organization/guides-hosting-backups-and-restore/#restore) .

## Automatic deploys

Menu option 8 (`scripts/install-runner.sh`,`--remove`to take it away) installs a GitHub Actions runner on the server. With the repository variable`SWO_DEPLOY=true`, the release workflow's`deploy`job runs`update.sh --force --version <release>`on it after each release. The previous release's images are kept on the registry for rollback.

## Other routes
- **Cloud:** `scripts/update.sh`is for the bundled stack only. Back up with your provider, set the new`SWO_IMAGE_TAG`, then run`scripts/spaceworks-compose.sh cloud pull`and`up -d --wait`. The`migrate`service runs the migrations. See[Deploying with managed services](https://spaceworkslabs.tech/docs/organization/deployment-cloud/) .
- **Render and similar platforms:**set`MIGRATE_ON_START=1`so the backend applies migrations before it starts, or run the image with`--role migrate`as a release step.
- **Netlify website:**redeploy the site after changing any`NEXT_PUBLIC_*`value; they are inlined at build time. See[Hosting the site on Netlify](https://spaceworkslabs.tech/docs/organization/deployment-netlify/) .

## Read next
- [Deploying on a server](https://spaceworkslabs.tech/docs/organization/deployment-vps/#updates-and-rollback)
- [Monitoring and health](https://spaceworkslabs.tech/docs/organization/guides-hosting-monitoring-and-health/) : check the stack after an update.
- [Architecture](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization/blob/7cd1441838559f323c26e5ddbab0e72181b4bc4d/docs/ARCHITECTURE.md#releases) : how releases and images are built.

From[SpaceWorks-Organization/docs/guides/hosting/updates-and-rollback.md](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization/blob/7cd1441838559f323c26e5ddbab0e72181b4bc4d/docs/guides/hosting/updates-and-rollback.md) at 7cd1441, updated 2026-11-21.[Suggest a change](https://github.com/SpaceWorks-Labs/SpaceWorks-Organization/edit/main/docs/guides/hosting/updates-and-rollback.md)  [PreviousMonitoring and health](https://spaceworkslabs.tech/docs/organization/guides-hosting-monitoring-and-health/) [NextDeploying on a server (VPS)](https://spaceworkslabs.tech/docs/organization/deployment-vps/)

On this page
- [Releases and tags](#releases-and-tags)
- [Update](#update)
- [What the updater does](#what-the-updater-does)
- [If an update fails](#if-an-update-fails)
- [A stuck lock](#a-stuck-lock)
- [Roll back](#roll-back)
- [What a rollback can and can't undo](#what-a-rollback-can-and-cant-undo)
- [Automatic deploys](#automatic-deploys)
- [Other routes](#other-routes)
- [Read next](#read-next)
