Stable Major Version Upgrades on macOS: A Practical Guide

    This guide explains why major version upgrades (for example, moving from a 0.x release to 1.x) often fail and how to make them predictable, verifiable, and reversible on macOS. It covers four pre-upgrade checks, the correct order of stopping services before pulling images, synchronized updates to orchestration and configuration, four-layer post-start validation, rollback strategy, a troubleshooting table, and a final upgrade checklist. The focus is on local container runtimes, where file sharing, port binding, and proxy settings behave differently from server environments.

    1. Why Major Version Upgrades Go Wrong

    Moving from a 0.x series to a 1.x series is rarely just a stack of new features. It usually involves architectural consolidation: a plugin mechanism is introduced, service boundaries are redrawn, database schemas undergo irreversible changes, and configuration keys are renamed or split. As a result, the risk during an upgrade comes from three places:

    • Old and new containers coexisting, causing port and volume mount conflicts.
    • Data structure migration being interrupted, leaving a “half-migrated” state.
    • Configuration files still using old fields, so services fail and exit immediately on startup.

    On macOS, these risks are amplified. Local container runtimes implement file sharing, port binding, and resource limits differently from server environments, disk usage grows faster, and network proxy settings are more likely to interfere with image registry access. So the core of “stability” is not speed, but making every step verifiable and reversible.

    2. Four Checks Before Upgrading

    1. Confirm version differences: Identify the currently running version and the target version, review the target release notes, and flag breaking changes such as added or removed configuration keys, data structure changes, and new dependent services.
    2. Back up data and configuration: Package the persistent directories (database files, uploaded files, caches, logs) and configuration files together, include a timestamp in the backup file name, and confirm the backup can be extracted and read.
    3. Confirm resources: Reserve enough disk space (at least twice the current usage is recommended) so that image layer extraction does not fail halfway due to insufficient space.
    4. Confirm access paths: Make sure the image registry is reachable. If your local network requires a proxy, configure the proxy separately for the container runtime in advance, avoiding the “host can reach it, container cannot” situation.

    Example backup command:

    1. TS=$(date +%Y%m%d-%H%M%S)
    2. tar -czf "backup-$TS.tar.gz" ./volumes ./conf
    3. ls -lh backup-*.tar.gz

    3. Stop Services First, Then Pull Images

    The original documentation stresses stopping the container services before downloading images, and this point is critical. Running services continuously write to data volumes and databases. Pulling and replacing images at that point easily leads to old and new processes writing to the same data alternately. The correct order is: stop services → pull images → verify backup → update configuration → start → validate.

    Example of stopping and pulling:

    1. # After entering the orchestration directory, stop the current services (keep data volumes)
    2. docker compose down
    3. # Pre-pull the target version images to avoid pulling and waiting during startup
    4. docker pull <api-image>:<target-tag>
    5. docker pull <web-image>:<target-tag>
    6. docker pull <plugin-daemon-image>:<target-tag>

    The benefit of pre-pulling is that it removes network uncertainty from the startup critical path. If an image is missing during startup, the orchestration tool will try to pull it over the network, and after a timeout the service ends up in a repeated restart state, which costs far more to troubleshoot than pulling in advance.

    4. Synchronizing Configuration and Orchestration Updates

    An image upgrade must be accompanied by synchronized upgrades to the orchestration file and configuration. Common items to handle include:

    • New dependent services: new components such as a plugin daemon need to be added to the orchestration, with health checks and dependency ordering configured.
    • Port and exposure scope adjustments: when access is local-only, prefer binding to the loopback address to avoid exposing the service directly to the LAN.
    • Data volume path changes: confirm that the mount points are consistent between old and new versions, avoiding the illusion that “data was written to a new directory while no one reads the old data.”
    • Environment variable replacement: when old fields are split or renamed, align item by item against the target version’s sample configuration, and do not keep useless old variables.

    5. Startup and Migration Validation

    Do not declare success immediately after startup. Validation is recommended in four layers, in order:

    1. Process layer: all containers are running, with no continuous restarts.
    2. Log layer: check whether key lines such as migration completion and listening port readiness appear in the startup logs.
    3. API layer: access the health check path and the home page, and confirm the responses match expectations.
    4. Business layer: log in, open an existing application, and initiate a minimal conversation or workflow to confirm historical data is still present.

    If migration is interrupted, restore the backup and retry first. Do not repeatedly restart in a “half-migrated” state, which usually makes the data structure more chaotic.

    6. Rollback Strategy

    Rollback depends on a usable backup. The rollback order is: stop services → restore data volumes and configuration → revert the orchestration file to the old version image tags → start → validate. Note that once the new version has completed a data structure upgrade, the old version may not be able to read the new structure. Therefore rollback must restore the data as well; switching image tags alone is not enough.

    7. Common Failures and How to Handle Them

    Symptom Common Cause Approach
    Image pull timeout Network or proxy does not cover the container runtime Configure a proxy separately for the runtime, or switch to a reachable image acceleration option
    Exits immediately on startup Missing or invalid configuration field Validate item by item against the target version’s sample configuration
    Port already in use Old container has not fully exited Confirm the container is removed, then start
    Data “disappeared” Mount path changed Check volume mappings, and roll back and restore if necessary
    Disk alert Old images and build cache piling up Clean up dangling images and unused caches, keeping images needed for rollback

    8. Upgrade Checklist

    • Breaking changes in the target version release notes have been confirmed
    • Data and configuration are backed up and verified as extractable
    • Disk space is sufficient
    • Services are stopped
    • All required images are pulled locally
    • Orchestration and configuration are updated in sync
    • All four validation layers have passed
    • Rollback steps and backup locations are recorded

    Following the order above turns the upgrade from “gambling on luck” into a standard, predictable, verifiable, and reversible procedure. To further reduce uncertainty caused by local environment differences, you can consolidate the whole workflow onto common cloud capabilities such as a cloud container platform, object storage, log services, and monitoring and alerting. For example, use object storage to hold backups, use a log service to search startup logs centrally, and use monitoring and alerting to set thresholds on container restart counts, so the same upgrade standard can be reused in production environments.