A Practical Guide to Upgrading a Self-Hosted LLM Platform Across Major Versions

    Upgrading a self-hosted large language model platform across a major version (e.g., from 0.15.x to 1.0.0) is a planned migration project, not a patch update. This guide walks through the full process: risk assessment and pre-upgrade inventory, backup and rollback design, pre-pulling container images within the maintenance window, configuration diffing, database schema migration and startup ordering, a structured acceptance checklist, and rollback and troubleshooting. It is intended for engineers and DevOps teams operating self-hosted LLM platforms in production.

    1. Understand the Risk First: A Major Version Upgrade Is Not a Patch Update

    Going from 0.15.3 to 1.0.0 means the leading “0” has become a “1”—under semantic versioning, this is a major version transition. Major version upgrades typically come with three categories of breaking changes: incompatible data models (table structures, indexes, field semantics), renamed or split configuration options, and adjusted service topology (new standalone processes, responsibilities extracted from a previously monolithic component). The correct mental model is therefore not “overwrite the old files,” but “a planned migration project.”

    An engineered migration must satisfy three prerequisites: it must be predictable (you know in advance what will change), rollbackable (a failure can be reverted to the original state within an acceptable time), and verifiable (there are clear acceptance criteria, not just “the UI opens, so we’re done”). The workflow below is built around these three points.

    2. Before Upgrading: Inventory and Compatibility Assessment

    Before touching anything, write down your current state as a checklist, so you never rely on memory mid-upgrade.

    The inventory should cover at least:

    • Current versions and deployment topology: the actual running version of each service component (not just what the config file claims), and whether the deployment is single-node or multi-node.
    • Component dependency topology: reverse proxy, application services, task/async queues, relational database, cache, vector store, object storage, log and metrics collection—who hosts each and where the data lives.
    • Data asset locations: database volumes, persistent directories or object storage buckets holding uploaded files and knowledge base source documents, and model provider credentials/keys.
    • Resource headroom: disk space must accommodate “new image extraction + retained old images + temporary tables/logs during database migration.” As a rule of thumb, reserve 3–5× the current image footprint.
    • Maintenance window: confirm a low-traffic period, notify users in advance, and state the exact start and end of the downtime.

    Also read the official release notes and upgrade guide, focusing on three things: minimum prerequisite versions (some platforms require upgrading to an intermediate version before crossing major versions), newly required configuration options, and removed deprecated options. Do not skip this step—the most common cause of failed cross-version migrations is skipping an intermediate version.

    3. Backup and Rollback Design: The Safety Foundation

    A backup is not just “making a copy”—it must be consistent and proven recoverable.

    Follow a “stop writes first, then back up” sequence:

    1. # 1) Stop application-layer writes to avoid data changing during the backup
    2. <container-orchestration-tool> stop <app-service>
    3. # 2) Back up the relational database (logical dump; best cross-version compatibility)
    4. <database-client> --host <host> --user <user> -p <db-name> > backup_$(date +%F_%H%M).sql
    5. # 3) Back up persistent volumes and upload directories
    6. tar -czf volumes_backup_$(date +%F_%H%M).tar.gz /var/lib/<volume-dir>
    7. # 4) Back up configs and orchestration files (including env files, which contain secrets—encrypt and store separately)
    8. tar -czf config_backup_$(date +%F_%H%M).tar.gz ./conf ./<orchestration-dir>

    Three key practices:

    1. Pin image tags. Do not use floating tags in your orchestration files, or a rollback may pull a different image than the original. Before upgrading, record the full tags and digests of all currently running images.
    2. Sample-verify your backups. At least once, start a temporary environment using the backup data and confirm it reads correctly. Otherwise, a backup is just psychological comfort.
    3. Manage secrets separately. Env files typically contain database passwords, object storage keys, and model provider credentials. Backup archives should be encrypted with restricted access, and never stored alongside ordinary logs.

    4. Pre-Pull Images Within the Downtime Window

    One of the most valuable lessons from practice: stop the container services before pulling images. There are three reasons:

    • Avoid write conflicts and data inconsistency: if the app keeps running during the pull, new writes may occur, making the pre-migration data baseline diverge from your backup.
    • Reduce resource contention: image extraction is I/O- and CPU-intensive; competing with the running application significantly lengthens the downtime.
    • Make downtime measurable: moving image pulls inside the downtime window makes the total duration measurable and easier to optimize later.

    Recommended sequence:

    1. # 1) Stop the container runtime and all orchestration services
    2. <container-runtime> stop <orchestration-project>
    3. # 2) Pre-pull all images required by the new version (tags strictly matching the official list)
    4. <container-runtime> pull <platform-web-image>:1.0.0
    5. <container-runtime> pull <platform-api-image>:1.0.0
    6. <container-runtime> pull <platform-plugin-daemon-image>:<official-tag>
    7. # 3) Verify the local image list—nothing missing, no wrong tags
    8. <container-runtime> images | grep <platform-name>

    If network pulls are unstable, you can pull the images during normal operation (the application keeps running; you just consume disk early), then run one more pull after downtime to catch any differences—this compresses the downtime window to just the migration and startup time. For air-gapped networks, use an internal image registry as a proxy cache, or transfer image archives via object storage, to reduce public internet dependencies.

    5. Diffing Configuration and Orchestration Files

    A new major version often introduces new required environment variables (e.g., addresses for new components, changed key length requirements, plugin-related switches) and deprecates old ones. A line-by-line diff is the most reliable approach:

    1. diff -u conf/old.env conf/new.env.example
    2. diff -u <orchestration-dir>/old.yaml <orchestration-dir>/new.yaml

    Focus on:

    • Ports and volume mounts for new components: major upgrades often split out standalone processes, which need ports, health checks, and persistent directories.
    • Database connection and migration switches: confirm the connection string and connection pool limits meet the new version’s requirements.
    • Object storage and file persistence paths: make sure the old and new versions point to the same location—otherwise you hit the classic failure of “all historical files return 404 after the upgrade.”
    • Reverse proxy routing rules: new services must have their routes added, or the frontend loads but the API returns 502.

    Principle: change only what must be changed and leave everything else as-is. Put configuration changes themselves under version control so you can roll back to an exact config revision when something breaks.

    6. Data-Layer Schema Migration and Startup Order

    Once configuration is ready, start the services; schema migration is usually executed automatically by the application during startup. Follow a “dependencies first, layered startup” order:

    1. Base dependency layer: relational database, cache, object storage, vector store;
    2. Async and task layer: message/task queues and their consumers;
    3. Core application layer: API service (triggers schema migration);
    4. Auxiliary layer: plugin daemons, task schedulers;
    5. Access layer: web frontend and reverse proxy.
    1. <container-orchestration-tool> up -d <dependency-services...>
    2. # Watch the core service logs and wait for the migration to finish
    3. <container-orchestration-tool> logs -f --tail=200 <api-service>

    During migration, watch the logs for three signals: the start and end markers of migration scripts, failure or timeout stack traces, and whether the connection count is maxed out. Do not start multiple application instances concurrently during migration—avoid multiple processes altering table structures at the same time.

    7. Acceptance Checklist: From “It Starts” to “It’s Deliverable”

    A successful startup is only the beginning. Validate along these dimensions:

    • Data integrity: spot-check knowledge base document counts, application configuration entries, historical conversations, and uploaded files for readability; compare against pre-upgrade statistics.
    • Functional pipeline: run the full loop of “create an app → upload a document → trigger parsing and vectorization → start a conversation → inspect invocation logs.”
    • New capabilities: verify the health of components introduced in the new version (health check endpoints, heartbeat logs).
    • Async tasks: confirm background task queues have no backlog and no recurring errors.
    • Observability: log collection works, and key monitoring metrics (error rate, latency, resource utilization) are reporting. If you deploy in the cloud, you can reuse general capabilities such as the container platform, object storage, logging, and monitoring/alerting instead of building everything yourself.

    8. Rollback Plan and Troubleshooting

    Write and rehearse the rollback script before the upgrade—never improvise it after a failure. The standard rollback path:

    1. <container-orchestration-tool> down # stop all new-version services
    2. # restore the logical database backup
    3. <database-client> --host <host> --user <user> -p <db-name> < backup_xxx.sql
    4. # restore persistent volumes and configs
    5. tar -xzf volumes_backup_xxx.tar.gz -C /
    6. tar -xzf config_backup_xxx.tar.gz -C ./
    7. # bring services back up with the pinned old image tags
    8. <container-orchestration-tool> up -d

    Face one harsh reality: once the new version has completed schema migration, the old version usually cannot read the new schema. So a rollback almost always requires restoring the database backup, which loses any new data generated during the upgrade window. This is the fundamental reason you must pick a low-traffic period and notify users in advance.

    Common failures and where to look first:

    Symptom First things to check
    Frontend loads but API returns 502 Has the reverse proxy added routes for new components; are ports mapped
    Container exits immediately, logs show missing config New required environment variables not filled in
    Migration stalls for a long time Database connection limits, disk space, lock waits
    Historical files inaccessible Persistent volume or object storage path configuration drift
    Plugin features broken Plugin daemon version/tag mismatch with the main version

    9. Turn Upgrades into a Repeatable Capability

    A successful upgrade should become an organizational asset: maintain an upgrade checklist (inventory, backup, pre-pull, config diff, migration, acceptance, rollback) and back-fill it with actual timings and pitfalls from each run; rehearse in a staging environment using a copy of production configuration; enforce pinned tags and archived image management. Once the process is institutionalized, a major version jump from 0.x to 1.x is no longer a high-risk event to be nervously navigated—it’s a routine, well-paced, verifiable change.