Upgrading a Containerized AI Platform: A Practical Guide to Major Version Migration

    This guide walks through a safe, step-by-step process for upgrading a containerized open-source AI application platform across major versions. It covers why major upgrades often break existing deployments, how to take a complete backup of the installation directory and image tags, how to merge new configuration files instead of overwriting custom values, the correct order for pulling images and rebuilding containers, and a three-layer post-upgrade health check across process, API, and data levels. It also explains how to migrate built-in tools and model providers to the new plugin architecture by exporting a plugin manifest and installing plugins in batches, plus a troubleshooting table for common failures such as restart loops, missing workflows, blank plugin pages, and failed rollbacks.

    1. Why Major Version Upgrades Go Wrong

    In containerized open-source AI application platforms, a cross-major upgrade (for example, moving from the 0.x series to the 1.x series) is rarely just an image swap. New major releases typically introduce a plugin-based architecture, a visual orchestration engine, and open ecosystem interfaces. As a result, configuration options, dependent components, and data directory structures may all change. If you replace only the images and ignore differences at the configuration and data layers, the most common outcome is that the service starts and users can log in, but historical workflows, knowledge base indexes, and model provider configurations have all “disappeared.”

    The core principle of upgrading comes down to one rule: make sure you can roll back first, then aim for a smooth migration. The steps below follow the actual operating order.

    2. Step 1: Keep the Backup Simple but Complete

    For instances deployed with a container orchestration file, the application directory usually contains three kinds of critical content:

    • Orchestration files and environment variable files (defining service topology, ports, secrets, database connections, and so on);
    • Data volume directories (database data, vector store indexes, uploaded files, caches, and so on);
    • Local custom configuration (reverse proxy configuration, extension initialization scripts, and so on).

    The safest approach is not to pick items one by one, but to make a complete copy of the entire installation directory, and additionally record the list of current image tags:

    1. # Check the versions of running images so you can align them during rollback
    2. docker compose ps --format "table {{.Service}}\t{{.Image}}"

    It is a good idea to place the backup directory on a different disk or mount point from the installation directory, so an accidental operation does not overwrite both. In a cloud environment, you can also store an off-site copy in object storage and use snapshot capabilities to take a point-in-time backup of the data disk, forming a double safeguard of “local copy plus cloud copy.”

    3. Step 2: Prepare the New Version Program Files

    After obtaining the new version source package from the official repository, do not extract and overwrite files in place in the original directory. The recommended process is:

    1. Extract the new version into a temporary directory;
    2. Compare the orchestration files and environment variable templates between the old and new versions (focus on newly added services and newly required variables);
    3. Copy the new version files into the original installation directory, overwriting files with the same names;
    4. Keep the custom variable values from the old version, and fill in placeholder values for the newly added variables.

    The key to this step is merging configuration rather than discarding it. Many upgrade failures are not program problems, but occur because a new service lacks a required environment variable, causing the container to restart repeatedly.

    4. Step 3: Pull Images and Rebuild Containers in Order

    Stopping the services before pulling images can significantly reduce the risk of interrupted data writes:

    1. docker compose down # Stop and remove old containers (data volumes are unaffected)
    2. docker compose pull # Pull the images required by the new version
    3. docker compose up -d # Rebuild and start in dependency order

    Note that the new architecture usually adds a dedicated service component responsible for plugin lifecycle management, which has startup dependencies on the main API service and the frontend service. If the main service starts before this component is ready, plugin-related pages will appear blank or throw errors. Therefore, after starting, observe for a while and confirm that all containers are running and that health checks pass.

    5. Step 4: Post-Upgrade Health Verification

    Do not just check whether the page opens in a browser. Verification in three layers is recommended:

    • Process layer: confirm that no container is restarting abnormally;
    • API layer: visit the application list page and the model configuration page, and confirm there are no 5xx errors;
    • Data layer: spot-check several historical applications and confirm that knowledge base document counts match those before the upgrade.

    If login works but historical orchestration content is missing, the data volume is usually not mounted correctly: copy the data volume from the backup directory to the corresponding directory of the new version as a whole, then restart the services to restore it. This also shows the value of the backup step, since it serves both as a rollback plan and as a data recovery source.

    6. Step 5: Migrating Plugins and Model Provider Configuration

    The new architecture turns previously built-in tools and model providers into installable plugins, so an explicit migration is required. The approach is “export the manifest first, then install in batches”:

    1. Locate the container ID of the main API service;
    2. Open a terminal inside the container;
    3. Run the export command to generate a manifest file describing all workspace plugin dependencies of the current instance (the export speed can be controlled with a concurrency parameter, which should be lowered when container resources are tight);
    4. Confirm that the container has public internet access and can reach the plugin marketplace domain;
    5. Run the install command to pull and install plugins in batches according to the manifest (a conservative concurrency setting is recommended to avoid interruptions caused by network jitter).
    1. # Example: run inside the main API container
    2. # Export the plugin manifest
    3. flask extract-plugins --workers=20
    4. # Install plugins according to the manifest
    5. flask install-plugins --workers=2

    If an enterprise environment cannot reach the public internet directly, prepare an internal mirror source or offline plugin packages in advance, and open the network policy before installation; otherwise the migration will fail entirely at the installation stage.

    7. Common Failures and Troubleshooting Checklist

    Symptom Common Cause Resolution
    Container restarts repeatedly A newly required environment variable is missing Add the variable and rebuild
    Workflows and knowledge base are empty Data volume not migrated or mount path changed Copy the data volume and restart
    Plugin page is blank Plugin management service not ready Check that service’s logs and dependency order
    Plugin installation interrupted Cannot reach the plugin marketplace Open network access or switch to offline packages
    Cannot roll back after upgrade No complete directory backup Restore the whole backup directory

    8. Final Thoughts

    The essence of a major version upgrade is an “architecture migration,” not a “version number replacement.” Completing these five things in order—backup, configuration merging, dependency order, data volumes, and plugin migration—will greatly improve the upgrade success rate. For production environments, it is recommended to run a full rehearsal on a test instance first, record the time taken and any anomalies at each step, and then apply the upgrade to production. In addition, prefer operating during off-peak business hours and notify the relevant users in advance. If deployed in the cloud, you can combine container platform, log service, and monitoring and alerting capabilities to observe error rates and resource levels in real time during the upgrade window, so that problems are detected early and rollbacks happen early.