Updating
An update replaces the application images and may change the database schema. Plan a short maintenance window. Keep a coordinated backup of PostgreSQL, Redis, configuration, and keys until the new version is verified.
If you are installing Maglane for the first time, use Installation instead.
If your current installation still uses the Magpie name, read Upgrade to Maglane before starting.
Before you update
- Read the release notes for the versions you are crossing. Check the migration notes below when upgrading an older installation.
- Record the current backend and frontend image tags or digests. A floating
latesttag alone does not identify a recoverable version. - Take and verify a coordinated backup.
- Confirm the Compose project name, ordered file list, and installation directory. They select your existing volumes and networks.
- Keep
PROXY_ENCRYPTION_KEYand the JWT signing secret unchanged. Stop every backend instance before migration, including replicas on other hosts.
Choose component versions
Frontend and backend images have separate version settings in .env:
MAGLANE_BACKEND_IMAGE=maglane/backend
MAGLANE_BACKEND_TAG=latest
MAGLANE_FRONTEND_IMAGE=maglane/frontend
MAGLANE_FRONTEND_TAG=latest
Pin immutable release tags for reproducible deployments. Select compatible
frontend and backend releases and deploy them together.
MAGLANE_IMAGE_TAG remains a shared fallback when a component tag is unset;
an explicit component tag takes precedence. See
image version settings
for the full reference.
Run the update helper
For an installation created by the one-command installer, run the appropriate
command from the directory containing your installation. The helper looks for
maglane/ first, then magpie/. For a custom installation path, set
MAGLANE_INSTALL_DIR to that path before running the command.
macOS and Linux
curl -fsSL https://maglane.io/update.sh | bash
Windows PowerShell
irm https://maglane.io/update.ps1 | iex
For a Git checkout of the distribution repository, use its wrapper:
./scripts/update-stack.sh
On Windows CMD:
scripts\update-stack.bat
The bundled helpers stop the backend, run the new image's migration, and restart only after it succeeds. Read the output before leaving the maintenance window. Do not start an old backend to work around a migration failure.
Keep the same Compose configuration
The Bash and PowerShell helpers inspect Docker labels to recover this
installation's project name, working directory, and ordered Compose file list.
This includes names set by an overlay's name:, -p, or
COMPOSE_PROJECT_NAME. The recovered name stays fixed even if downloaded
configuration changes it.
A stopped backend retains these labels, so a retry after a failed migration can reuse the same project and production overlay. Helpers ignore unrelated projects and one-off migration containers. Missing files, an inspection error, or multiple matching configurations stop the update before the backend stops. The Git checkout wrappers use the same logic.
After docker compose down, there is no backend container to inspect. Save your
selection in .env before removing containers:
COMPOSE_FILE=docker-compose.yml:docker-compose.production.yml
# Set this too if the installation uses a custom project name:
# COMPOSE_PROJECT_NAME=maglane-production
Use ; instead of : on Windows. Append custom overlays in their original
order. Without an existing backend, helpers use Compose settings from the shell
or .env, or the normal default files. MAGLANE_ENV=production also enables
backend production defaults, but the file selection still determines mounts,
ports, and other Compose behavior.
Manual production update
Run this Bash block from the distribution directory. Add every custom overlay
to every command, or persist the full list through COMPOSE_FILE.
The subshell exits on a failed command, leaving the backend stopped after a
migration failure.
(
set -e
docker compose -f docker-compose.yml -f docker-compose.production.yml pull
docker compose -f docker-compose.yml -f docker-compose.production.yml stop backend
docker compose -f docker-compose.yml -f docker-compose.production.yml run --rm backend --migrate-only
docker compose -f docker-compose.yml -f docker-compose.production.yml up -d
)
This stops the backend in this Compose project. Stop any other instances that share its database and Redis before running it. Keep all instances stopped until the migration finishes.
Verify the new version
- Run
docker compose psand inspectdocker compose logs --tail=100 backendwith the same file selection. - Check readiness through your monitoring path. In production, send
X-Observability-Tokenwhen required. - Sign in, select the expected workspace, and compare active, paused, and archived proxy counts with your pre-update notes.
- Confirm new checks complete and scraper jobs resume. After checker settings migrations, current health can stay unknown until matching evidence arrives.
- Test one rotating listener with the protocol and credentials your clients use. Review alerts and outbound email if configured.
Use Troubleshooting for a specific failure. A running container alone does not prove the update succeeded.
Roll back after a schema change
Restore the matching PostgreSQL and Redis backups, configuration, keys, and previous component images using the recovery runbook. Schema migrations can remove columns that older binaries need. Changing an image tag back is therefore insufficient after an incompatible migration.
Migration notes for older installations
Alerts
Run --migrate-only with all backend instances stopped before starting an
alerts-capable release. The migrations create workspace alert rules,
destinations, incidents, and delivery records. They also add chat mention
settings and internal attempt timestamps that preserve evaluation priority
across timeouts and leadership changes. Apply the current migration even if
the installation already has alerts.
Deploy the matching frontend to expose the Alerts page. Existing workspaces
start with no rules, and destination mentions default to off. Destination
addresses and signing secrets are encrypted with PROXY_ENCRYPTION_KEY;
retain that key with PostgreSQL backups. The alerts guide
covers setup, permissions, incident timing, and delivery.
Scrape source settings
The source migrations add fetching mode, last-scrape status, and automatic tag rules to workspace source associations. Existing sources retain browser rendering and start with no automatic tags. Tag rules affect future scrape results, including rediscovered proxies, and add missing tags without replacing existing assignments.
Upgrade all backend workers together so they respect the selected fetching mode, source tags, and scheduling intervals. Deploy the matching frontend to show scrape status and scheduling details. The scheduling fix itself needs no new schema or environment settings. See the scrape source guide and scraping internals.
Statistics longevity
The longevity migration adds replay-floor storage, a sortable statistics-ledger
key, and lifetime check totals. Moving large DEFAULT-partition history can
extend the maintenance window. Keep all backend instances stopped during
--migrate-only and retain coordinated PostgreSQL and Redis backups.
After migration, partition precreation continues with DB_AUTO_MIGRATE=false.
The per-route daily check counters this migration introduced are no longer
written since the dashboard snapshot release below. See
results and storage for retention,
replay, and read-model behavior.
Notification read status
The notification update adds notification_reads through the normal
--migrate-only step. Update the backend and frontend together. Read receipts
are account data in PostgreSQL and need no extra volume or environment setting.
Existing notifications start unread; opening an item saves its read status for
every browser signed in to that account.
Workspace ownership migration
The workspace release performs an ownership-boundary migration:
- creates one personal workspace, owner membership, entitlement, and preference row for every existing account;
- copies each account's operational settings into that workspace;
- moves managed proxies, tags, assignments, judges, scrape sources, rotators,
histories, and snapshots from
user_idownership toworkspace_idownership; - keeps existing managed proxies active initially; and
- repairs PostgreSQL foreign keys to reference
workspaces.
The migration deliberately uses the legacy account ID as the personal
workspace ID where possible, but clients must discover workspaces through
GET /api/workspaces instead of relying on that detail. Existing API clients
that omit X-Workspace-ID continue through the migrated default workspace.
Do not run an older backend against the migrated database. There is no in-place downgrade because ownership columns and constraints have changed; restore the coordinated PostgreSQL and Redis backups to roll back.
Tag checker settings migration
Update the frontend and every backend instance together. Stop all backend
instances, run --migrate-only, and start the new images after it succeeds.
This release adds workspace protocol defaults and ordered tag rules, a sparse
projection for tagged proxy checks, and workspace/configuration attribution to
latest statistics. The latest-statistics primary key changes; older workers
must not write to the migrated database.
Existing checker values become shared Default settings with no tag rules. Earlier per-protocol draft profiles remain readable and convert to shared values using the first enabled Default protocol and first explicit rule fields in HTTP, HTTPS, SOCKS4, SOCKS5 order. If converted transports are incompatible with SOCKS, conversion uses TCP. Legacy statistics remain available as history. Their transport and settings cannot be reliably attributed, so current health starts unknown until fresh matching checks complete. TCP rotators also wait for current TCP evidence. Existing failure streaks are retained.
No new environment variables are needed. Keep PROXY_ENCRYPTION_KEY stable and
retain the coordinated backups for rollback. Redis queue payloads and ordinary
requeue scheduling keep their existing format and credential policy.
Checker projection refreshes reconcile committed keys and tag overrides across backend instances. Unrelated classification tags do not refresh workspace health, and checker tag edits refresh only affected proxy and source summaries. Dashboard caches verify the committed checker generation before serving health. Unchanged reconciliation skips route reads; column-only saves skip checker refresh. Recent checks select indexed candidates before fetching their evidence.
Run the updated migration even when upgrading an earlier tag-settings build. It adds workspace revision counters, a coalesced per-route change journal, and an index for active recent-check candidates. These changes require no new environment settings and add no database queries to individual checker runs. The journal retains temporary removal records so a reimported proxy does not reuse settings from its previous tag membership. Retention maintenance expires committed removal records after 24 hours; workspace deletion removes its journal.
Dashboard snapshots
Update the frontend and every backend instance together. This release stores
dashboards as shared snapshots in PostgreSQL (dashboard_snapshots) instead of
a per-instance cache, and adds the dashboard_lease_epoch_seq sequence. The
migration creates both; no data is converted. The first dashboard view of each
workspace after the upgrade builds its snapshot and can briefly show
"Updating".
- "Checks this week" is replaced by "Checks this month", the allowance period, and "Total checks" now counts only the workspace's own check requests since the workspace was created. Existing installations see a lower total than before, which counted checks of the workspace's routes by any workspace.
PROXY_DAILY_CHECK_RETENTION_DAYSis removed. The per-route daily check counters stop being written; their tables stay until the next release.- New optional settings tune snapshot builds:
DASHBOARD_BUILD_DEADLINE,DASHBOARD_BUILD_CLUSTER_LIMIT,DASHBOARD_BUILD_INSTANCE_LIMITandDASHBOARD_BUILD_STATEMENT_CONCURRENCY. See the environment reference. GET /api/getDashboardInfoand the GraphQL fieldsviewer.dashboard,viewer.recentProxyChecksandviewer.fastestAliveProxiesare removed. Useviewer.dashboardView.
Dropping the daily check counter tables
The release after the dashboard snapshot release drops proxy_daily_checks,
proxy_check_totals and proxy_daily_check_proxy_backfills. Multi-instance
installations must install the dashboard snapshot release before it and must
not skip it: an older backend still writes daily counters, and its statistics
transactions fail once the tables are gone. Upgrades that skip releases keep
the usual procedure of stopping every backend before migration.
Frontend and API compatibility
Deploy compatible frontend and backend releases together when crossing these changes:
- Rotator creation accepts any supported upstream protocol even when Default checker settings disable it. Older backends reject those requests. Serving traffic still requires current successful TCP evidence for the chosen protocol. See rotating proxies.
- The frontend restores account details through
GET /api/user/profile, saves theactions_buttonscolumn preference, and sendssortFieldandsortOrderfor scrape source sorting. Older backends may lack the endpoint, discard the preference, or ignore the sort. See account APIs and scrape source APIs. - The dashboard reads
viewer.dashboardView, which replacesviewer.dashboard,viewer.recentProxyChecks,viewer.fastestAliveProxiesandGET /api/getDashboardInfoin the same release. During a rolling upgrade, or in a browser tab still running the previous frontend, the dashboard query fails validation in either direction and the page shows its error state. Retrying resends the same query; reload the page. - GraphQL clients must omit
scrapingSourcesfromUpdateUserSettingsInput. The former no-op input now fails validation. Manage sources through REST. Settings mutations also reject negative or oversized checker integers. See GraphQL settings.