Upgrading a Containerized AI Application Platform Across Major Versions: A Practical Guide

    This guide walks through a real-world major version upgrade of a containerized AI application platform, using the jump from 0.15.3 to 1.0.0 as the example. It explains why cross-version upgrades tend to fail, how to establish version, data, and configuration baselines, and how to make a full host-level backup a hard requirement for rollback. You will find the concrete steps for replacing deployment code and images, controlling startup order, verifying the upgrade, migrating plugins and model providers, and troubleshooting common failures such as missing workflows, restart loops, and stalled plugin installation. The goal is to turn a risky upgrade into a repeatable, verifiable procedure.

    1. Why Major Version Upgrades Go Wrong

    In the evolution of open-source AI application platforms, moving from 0.x to 1.x is rarely a simple patch update. It is often an architectural rebuild. Take the jump from 0.15.3 to 1.0.0: the new release introduces a plugin-based capability system, a more complete visual orchestration flow, and a more open extension ecosystem. A direct consequence is that container composition, environment variables, the persistent directory layout, and the initialization flow may all change.

    Most failed upgrades are not caused by a mistyped command. They happen because three baselines were never established before the work began:

    • Version baseline: know exactly which version is running and which images and services make it up.
    • Data baseline: know which directories hold the database, vector index, object storage, and model cache.
    • Configuration baseline: know the environment variable files, reverse proxy, port mappings, and external dependency addresses.

    If all three baselines are fully documented before the upgrade, the vast majority of later anomalies can be traced quickly.

    2. Preparation: Make Rollback a Hard Constraint

    2.1 Keep the Full Backup Simple and Verifiable

    For instances deployed through container orchestration, the most reliable backup strategy is to copy the entire installation directory directly at the host level. The approach is plain, but it has one major advantage: it packages configuration, persistent volumes, and custom scripts in a single pass, so rolling back only requires switching back to the original directory.

    The recommended backup steps are:

    1. # Stop the orchestration services first so data is at rest
    2. cd /path/to/deploy/docker
    3. docker compose down
    4. # Go up one level and copy the whole directory
    5. cd ..
    6. cp -a deploy deploy_backup_0153

    Two points need attention. First, always stop the services before copying; copying while writes are in progress can leave data files in an inconsistent state. Second, after the copy finishes, confirm that the directory size is close to the source, in case insufficient disk space caused a silent truncation.

    2.2 Record Key Configuration Differences

    Before upgrading, export the environment variable files and orchestration files separately to build a readable comparison list. Focus on image tags, the versions of dependency middleware, persistent mount paths, and health check configuration. This list is extremely valuable when diagnosing “services won’t start” after the upgrade.

    3. Replacing Code and Images: Version Alignment Is the Core

    3.1 Overwrite the Old Directory with the New Version Code

    After obtaining the new deployment code, copy all of its files over the existing installation directory. The key phrase is “replace everything,” because the new version may add initialization scripts, new service definitions, and new persistent subdirectories. A partial overwrite easily produces a torn state where the orchestration files are new but the initialization scripts are old.

    3.2 Stop Services Before Pulling Images

    Stopping the container services before pulling the new images significantly reduces resource contention between image layers and running containers. It also prevents old containers from repeatedly restarting during the pull and generating noisy logs. Example:

    1. docker pull registry.example.com/ai-platform-web:1.0.0
    2. docker pull registry.example.com/ai-platform-api:1.0.0
    3. docker pull registry.example.com/ai-platform-plugin-daemon:0.0.3-local

    Neutral registry placeholders are used here on purpose; replace them with the image registry available in your own environment. If network access is restricted, pull the images in a connected environment ahead of time, export them as archives, and import them later.

    3.3 Startup Order and Dependencies

    The new version usually adds plugin-related services. Start them in the order “middleware first, then core services, then plugin services.” In practice, letting the orchestration tool bring everything up is enough:

    1. cd docker
    2. docker compose -f docker-compose.yaml up -d
    3. docker compose ps

    Do not draw conclusions immediately after startup. Use docker compose logs -f to watch the core service initialization logs and confirm that steps such as database migration and cache initialization have completed.

    4. Verifying the Upgrade: Confirm It Works Before Anything Else

    Open the platform entry point and go to the application list page. If you can log in normally and see the application list, the basic path is working. If you see “applications are still there but workflows are gone,” do not panic. This is usually not data loss but persistent directories that were not inherited correctly.

    The fix is to copy the volume directories holding persistent data from the old deployment directory to the corresponding location in the new one, then restart the services:

    1. cp -a deploy_backup_0153/docker/volumes/. deploy/docker/volumes/
    2. cd deploy/docker && docker compose restart

    After the restart, check again whether all four component types are healthy: the orchestration engine, the relational database, the vector search service, and object storage. The criterion is clear: all four components ready, with no continuous connection-failure retries in the logs.

    5. Migrating Plugin Capabilities: The Real Difficulty of This Upgrade

    The new version abstracts model providers and tool capabilities into plugins. Providers and tools configured directly in the old UI must be “extracted and installed” once before they remain usable in the plugin environment.

    5.1 Locate the Core Service Container

    List the running containers and find the identifier of the core service container:

    1. docker ps

    5.2 Enter the Container and Extract

    1. docker exec -it <container-id> bash
    2. poetry run flask extract-plugins --workers=20

    This command scans the models and tools configured in the current instance and generates a description file that stores the extraction result. The workers parameter controls parallelism: a larger value is faster but puts more pressure on memory and database connections, so start with a smaller value and increase it gradually.

    5.3 Install into the New Plugin Environment

    1. poetry run flask install-plugins --workers=2

    The installation stage requires the container to have network access to the external plugin marketplace. If your environment is network-isolated, prepare a working egress policy or proxy in advance; otherwise the installation step will wait for a long time and then fail. After installation, return to the UI to confirm that model providers and tools are available again, and run one minimal-cost connectivity test for each.

    6. Common Failures and How to Diagnose Them

    • Login works but business objects are empty: suspect that persistent directories were not inherited first, and follow the steps in Section 4.
    • Core service restarts repeatedly: check the initialization logs; this is usually a missing environment variable or middleware that is not ready.
    • Plugin installation hangs with no response: check egress capability and whether the target address is reachable, then lower the parallelism and retry.
    • Rollback is needed after the upgrade: stop the services, switch back to the backup directory, and bring the stack up again. Data will not be overwritten by the new version’s initialization, provided the backup was taken while the services were stopped.

    7. Three Long-Term Recommendations for Platform Users

    First, make “stop services and back up” the fixed first step of the upgrade process, not a remedy applied after the fact. Second, prepare a configuration comparison list before upgrading so version differences can be understood by a human. Third, treat plugins and model configuration as assets that need migration, and include them in the upgrade checklist. With these three practices, a major version upgrade stops being a matter of luck and becomes a repeatable, verifiable standard procedure.