Upgrading a Containerized AI Application Platform: A Practical Guide to Cross-Version Migration
This guide walks through upgrading a containerized AI application platform across major versions, from 0.x to 1.x. It explains why replacing container images alone is not enough, then covers full-directory backups, aligning code and configuration files, pulling matched images, verifying the upgrade, and migrating plugins. It also lists common failure modes and a rollback strategy to help teams complete the upgrade with less risk.
1. Why Cross-Version Upgrades Often Go Wrong
Moving from 0.x to 1.x in an open-source AI application platform is rarely just a version number swap. In the 0.x stage, the platform focused on conversational applications, prompt orchestration, and basic workflows. The 1.x stage introduces a plugin-based mechanism that decouples model providers, tool calling, and retrieval augmentation from the main application and runs them in separate plugin processes. This means the new version changes not only the application-layer code but also how data is organized and how the runtime topology is structured.
Most failed upgrades do not come from a mistyped command. They come from treating “replace the code” as “the upgrade is done.” The old data volumes, database schema, vector indexes, and configuration files remain in their old form. Once the new image starts, it cannot read the existing workflows and cannot find the previously configured models and tools. The correct sequence is: back up first, align code and configuration, pull the matching images, and then run the data and plugin migration separately.
2. Before the Upgrade: Keep the Backup Simple
For community deployments that use container orchestration, the local machine usually has a complete deployment directory containing the orchestration files, the environment variable file, and the mounted data volume directories. The most reliable backup is to copy the entire directory rather than selected files.
# Assume the original deployment directory is /opt/app-platformcp -a /opt/app-platform /opt/app-platform.bak-$(date +%Y%m%d)
The -a flag preserves symlinks, permissions, and timestamps, which prevents ownership mismatches during a later restore. If the data set is large, stop the services before copying so that data files are not captured mid-write. In addition to the directory backup, take a logical export of the database as a second layer of protection.
3. Aligning Code and Configuration: Overlay the Old Directory with the New Files
After obtaining the new source code, copy all of its files over the original deployment directory. The key point is to replace everything, not just the orchestration files. The new version adds environment variable templates, initialization scripts, and plugin-related configuration items. Missing any of them can leave the containers restarting repeatedly after startup.
Before the overlay, compare the differences in the environment variable file:
# Back up the original environment variable file, then diff the new itemscp docker/.env docker/.env.olddiff docker/.env.old docker/.env.new
For newly added secret entries, generate new random values. For existing settings such as database connections, cache addresses, and object storage, keep the original values so the migrated deployment can still reach the existing data.
4. Pulling Images and Starting Services
Stop the running services before pulling images to reduce resource contention from image layer writes:
docker compose -f docker-compose.yaml down# Pull the new images one by one and make sure the api, web, and plugin daemon versions matchdocker pull <registry>/app-web:1.0.0docker pull <registry>/app-api:1.0.0docker pull <registry>/app-plugin-daemon:0.0.3docker compose -f docker-compose.yaml up -d
The three images must be used as a set. The plugin daemon is a new component in 1.x. If you keep the old orchestration file, that container is never created and plugin-related features remain unavailable.
5. Verifying the Upgrade
Once the services are up, open the application list page in a browser to confirm the service is available. If you can log in but the workflow list is empty, the application layer is ready and the problem is an unmigrated data volume. Copy the data volumes from the backup directory into the new mount directory, then restart the services.
cp -a /opt/app-platform.bak-YYYYMMDD/docker/volumes/. /opt/app-platform/docker/volumes/docker compose -f docker-compose.yaml restart
6. Plugin Migration: The Real Focus of This Upgrade
Under the new architecture, the model providers and tools configured in the UI must be extracted into plugin descriptor files and then installed into the plugin runtime environment.
Step 1: Locate the application backend container.
docker ps # find the ID of the api container
Step 2: Open a shell inside the container.
docker exec -it <containerID> bash
Step 3: Extract the models and tools already in use on this instance to generate a plugin manifest file. Adjust the concurrency based on the number of CPU cores on the machine:
poetry run flask extract-plugins --workers=20
This command outputs a manifest file in JSONL format, with one line per workspace describing the plugins it uses. Before running it, confirm that the host running the container can reach the public internet and the plugin marketplace address. Otherwise, the extracted entries will fail during installation.
Step 4: Run the installation in the same container.
poetry run flask install-plugins --workers=2
The installation stage is more sensitive to network and disk I/O, so a high concurrency level is not advisable. Two to four processes are usually more stable. After installation, restart the plugin-related containers and return to the UI to confirm that the model providers and tools are available again.
7. Common Risks and Rollback Strategy
First, image and code versions may not match, which shows up as containers restarting repeatedly. Go back to the orchestration file and check the image tags. Second, the data volume copy may be incomplete, which shows up as some applications visible and others missing. Check whether the mount path covers all subdirectories. Third, plugin installation may be interrupted. You can rerun the install command, which is idempotent. If the overall upgrade fails, stop the services and roll back the backup directory to return to the pre-upgrade state. This is the biggest value of taking a full-directory backup.
If the deployment runs in the cloud, you can combine the container platform, object storage, and snapshot capabilities to turn backup and rollback into a standardized process and further reduce upgrade risk.
