A Practical Guide to Major Version Upgrades for Containerized AI Application Platforms

    This guide walks through a real-world major version upgrade of a containerized AI application platform, where the jump from 0.x to 1.x restructures the underlying architecture rather than just the application code. It explains why upgrades appear to succeed while workflows, knowledge base indexes, and model provider configurations seem to disappear, and then lays out a rollback-safe sequence: back up the deployment directory into a restorable asset, diff and merge environment configuration, pull images in dependency order, rebuild containers and run health checks, restore persistent volume data, and migrate model providers and tools through the extract-and-install extension flow. Readers will find the concrete commands, verification checkpoints, and post-upgrade practices needed to keep the process controllable and reversible.

    1. Why Major Version Upgrades Go Wrong

    AI application platforms iterate quickly, and a cross-major-version upgrade is almost inevitable for anyone running a self-hosted deployment. With the common container orchestration setup, moving from the 0.x series to the 1.x series is rarely just an application code change. The underlying architecture is re-partitioned: model integration and tool-calling capabilities that used to live inside the main service are extracted into standalone extension runtime components, and configuration key names, volume mount paths, and initialization scripts change along with them.

    This produces a familiar symptom: the image pulls fine, the containers start, the admin console is reachable, but previously created workflows, knowledge base indexes, and model provider configurations have all “disappeared.” The cause is usually not deleted data. The new version reads data from a different path or in a different format, and the old data is still sitting quietly in the original mount directory, never mounted into the new deployment.

    The core strategy, therefore, is: guarantee rollback first, resolve configuration differences second, migrate data and extensions last. The steps below follow the actual operating order.

    2. Step 1: Make the Backup a Rollback-Ready Asset

    Many tutorials reduce backup to a single line — “remember to back up” — which is exactly the part that needs to be made concrete in practice.

    For a container orchestration deployment, the installation directory typically holds three things: the orchestration files with image version declarations, the environment variable configuration file, and the volume directories that carry persistent data. The safest approach is to stop the services first, then make a full copy of the installation directory, rather than hot-copying while containers are running.

    Illustrative commands:

    1. # Enter the deployment directory and stop services first to avoid capturing data mid-write
    2. docker compose -f docker-compose.yaml down
    3. # Keep the original directory and create a timestamped full copy
    4. cp -a ./ai-platform ./ai-platform.bak-$(date +%Y%m%d)

    If the data set is large, you can back up only the volume directories and the environment variable file, but keeping a full copy of the orchestration files is still recommended, since the new version may change the orchestration structure and a rollback needs the original restored as-is.

    Two easily overlooked details: first, if external object storage holds uploaded files, confirm that the bucket data is also backed up or covered by a versioning policy; second, record the database connection string and secret-type variables separately in a secure local file, so you are not filling them in from memory later.

    3. Step 2: Get the New Deployment Files and Handle Configuration Differences

    Once the new version is released, the official deployment file package is available. The key action is not a simple overwrite, but diff first, then merge.

    Recommended flow:

    1. Extract the new deployment files into a temporary directory;
    2. Diff the environment variable templates, focusing on newly added required items, such as the extension service address, the extension service auth token, and sandbox or code execution related settings;
    3. Migrate the secrets, database credentials, and storage configuration already present in the old environment into the new template;
    4. Replace the orchestration files in the old directory with the merged configuration.

    Illustrative diff check:

    1. diff -u ./ai-platform.bak-20240101/docker/.env.example \
    2. ./ai-platform-1.x/docker/.env.example

    When a newly required item is missing, containers often restart repeatedly or exit immediately after starting, and the logs show a configuration validation failure. In that case, read the container logs before rushing to change code.

    4. Step 3: Pull Images in Dependency Order

    A new version usually ships multiple components: frontend service, backend API service, extension runtime service, database, cache, vector search, object storage, and so on. It is best to stop the old services first, then pull images one by one, avoiding bandwidth contention that leads to timeouts and interrupted downloads.

    1. docker compose -f docker-compose.yaml down
    2. docker pull <frontend-service-image>:<new-version>
    3. docker pull <backend-api-image>:<new-version>
    4. docker pull <extension-runtime-image>:<corresponding-version>

    If the network is unstable, configure a registry mirror or pull in batches. Images that have already been pulled will not download again, so retrying after an interruption is safe.

    5. Step 4: Recreate Containers and Run Health Checks

    With configuration and images in place, start the services:

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

    Do not draw conclusions immediately after startup. Verify in this order:

    • Are all containers running, with no frequent restarts;
    • Did the database migration task finish, with no persistent errors in the backend logs;
    • Open the application entry point in a browser and confirm login works;
    • Go to the application list page and confirm historical applications are visible.

    This step only proves that “the new version is running.” It does not mean the data has been fully migrated.

    6. Step 5: Put Data Volumes in Place and Recover Historical Workflows

    If login works but the application list is empty, in most cases the persistent directory is not mounted. The fix is to copy the volume directories from the old deployment directory into the new one, then restart the services:

    1. cp -a ./ai-platform.bak-20240101/docker/volumes/. \
    2. ./ai-platform-1.x/docker/volumes/
    3. docker compose -f docker-compose.yaml restart

    Note that the copy must happen while services are stopped. After copying, watch the database container logs first to confirm that index rebuilding or schema upgrades produced no errors, then verify in the UI. If things are still incomplete, check whether the old directory used custom mount paths and add the same mount declarations to the new orchestration file.

    7. Step 6: Migrating Model Providers and Tools to the Extension Model

    The new architecture loads model integration and tool capabilities as extensions, so providers and tools configured in the old version do not appear automatically in the new one. The migration has two phases: extract, then install.

    First, locate the backend API container:

    1. docker ps

    Enter that container, then extract the list of extensions in use on the current instance into a manifest file:

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

    workers controls the parallelism and can be adjusted to the number of cores on the machine. The generated manifest records the extension identifiers and version information used by each workspace. Then run the install in the same container:

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

    This phase is network intensive, since the install needs to reach the extension marketplace repository. Make sure outbound access works; if it fails, check the proxy, DNS, and egress policy first instead of repeatedly recreating containers. After the install completes, refresh the page, check that model providers and tools are registered and usable, and run one end-to-end invocation test on a critical application.

    8. Post-Upgrade Recommendations

    • Keep the backup directory for at least one to two weeks, and clean it up only after confirming the business is stable;
    • Add a scheduled backup task for the persistent directories, since data risk in containerized deployments is concentrated in the volume directories;
    • Follow the same order for later minor version upgrades: back up, diff the configuration, then migrate;
    • In production, rehearse the full procedure once in a replica environment before touching the live instance.

    Overall, the difficulty of a cross-major-version upgrade lies not in the commands themselves, but in tracking three threads: configuration differences, mount paths, and extension registration. Proceeding in the order of backup, configuration merge, image pull, verification, data restoration, and extension migration makes the upgrade controllable and reversible.