Skip to content
On this page

Upgrade and rollback ​

Compose uses setup.sh upgrade. Kubernetes uses a separate upgrade.sh script. Use the commands for your deployment method.

Before upgrading ​

  • Keep the current release package, installation configuration, secrets, and data backups. Record the currently running version.
  • Obtain the complete artifact for the deployment method, target version, and server architecture from Server releases.
  • Schedule a maintenance window and reserve disk space for both old and new images. Stop writes from affected tasks.
  • Follow the target package's upgrade instructions to determine whether digital employee state or storage requires migration. If it does, complete the steps for the applicable version first.

Database migrations run forward only. Rolling back an application image or Helm release does not undo a migration. To restore the pre-upgrade state, determine whether the database and persistent data must also be restored.

Upgrade to v5.20.0 ​

  • Back up the primary database and workspace file storage. Record the application version that matches the backups. Database migration 0182 backfills definition snapshots and approval timestamps for existing digital employees.
  • Update automated integrations that handle digital employee packages to use .employee.zip. The development workspace no longer generates the old employee JSON format. The legacy full ZIP snapshot API returns 409 when the current workspace contains binary or large file references. Switch affected integrations to workspace file retrieval.
  • If upgrading TeGo Harness at the same time, verify workspace restore for added, changed, and deleted files. Then check the tasks and deliveries of existing digital employees. No additional model configuration changes are required.

For other changes and checks, see the v5.20.0 release notes.

Upgrade Compose ​

Use root or sudo privileges on the original installation host.

  1. Verify the new package's SHA-256 checksum. Back up config.env, .secrets, host/.env, infrastructure/master/.env, and both volumes/ directories. Archive the old images/ outside the installation directory, then extract the new package into the original installation directory.

  2. Confirm that the configuration and data still match the live environment. If the new package overwrote any settings, restore your deployment configuration and credentials. Check that the new images/ contains only the target version's image archives and manifests.

  3. From the original Compose package root, run:

    bash
    sudo ./setup.sh upgrade
    sudo ./setup.sh status
  4. Review the image, configuration, and health check output. Then follow the post-upgrade verification steps on this page.

The script verifies manifests, loads local images, reuses existing secrets, and recreates infrastructure or application services to apply the changes. After upgrading, verify digital employee and plugin operation.

Upgrade from a version with legacy speech recognition settings ​

For tenants using the legacy speech recognition setting (“语音识别”), enable and configure a compatible speech plugin under App Ecosystem (“应用生态”) in the old version first. If the tenant already uses the Qwen speech plugin, set the old speech recognition provider to None (“无”) so two provider accounts do not affect automatic assignment (“自动”).

Check the digital employee's meeting recognition setting (“会议识别”) for the legacy Inherit / Custom / Off options (“继承 / 自定义 / 关闭”). If the old form appears, follow UPGRADE_CLAWS.md in the package to update the runtime, then check the speech plugin status. If preflight fails, follow the script instructions to update the old settings and retry. A failed preflight does not replace the existing images.

Migrate legacy OpenClaw runtime state ​

The v5.20.0 full Compose package does not include the old migrate-claw-v2026.8.1.sh script. If an existing environment has not completed that migration, retain the workspace and runtime state. Send the current and target versions to Technical support to confirm the upgrade order. During migration, do not let old and new runtime containers write to the same state.

Upgrade Kubernetes ​

Run the upgrade on Node1. It requires kubectl and Helm access to the existing cluster, plus SSH access to the configured nodes. Extract the new package to a separate directory and keep the old one for comparison or recovery.

  1. Locate the original installation's config.env. The default location is /opt/tego-os/config.env. If DATA_ROOT was set, use the actual path to tego-os/config.env under that location.

  2. From the root of the new Kubernetes package, run:

    bash
    ./upgrade.sh --from /opt/tego-os/config.env
  3. Review the merged configuration, backup directory, image import on each node, and Helm deployment result.

  4. Follow the post-upgrade verification steps for smoke test output and application behavior. Keep the pre-upgrade configuration and database backups.

--from takes the path to the old configuration file, not a directory. The script merges old credentials with new settings, exports the three databases, saves Helm records, distributes images to the configured nodes, and calls the application installer.

OptionPurpose
--backup-dirSet the backup output directory.
--with-e2eRun end-to-end regression checks after deployment.
--skip-smokeSkip the post-upgrade smoke checks.
--skip-backupSkip the script's backup only when an independent, restorable backup exists.

The script upgrades only application images and the Chart. It does not upgrade K3s or the bundled PostgreSQL, Redis, LDAP, and Garage containers. If the longhorn StorageClass is missing, the upgrade stops during preflight. Prepare storage as described in the package's UPGRADE.md.

Migrate legacy persistent volumes ​

  • For older versions using a shared digital employee PVC named <StatefulSet>-shared, run migrate-avatar-pvc.sh --dry-run as described in UPGRADE.md. During the maintenance window, migrate to a separate Longhorn PVC for each runtime replica. Check historical replica counts for stopped digital employees before migrating. Do not start them on empty volumes.
  • For older versions still mounting a knowledge service PVC at /opt/maxkb, retain custom configuration, initialization scripts, and language packs from the volume. The new Chart no longer declares this volume. Keep a separate knowledge database backup that includes Large Objects.

Verify the upgrade ​

  1. Check service health or Pod readiness. Confirm that initialization and database migrations reported no errors.
  2. Open the live endpoint. Verify sign-in, existing files, and knowledge retrieval, then run a digital employee task.
  3. Check any messaging, plugin, or browser capabilities affected by this upgrade, together with scheduled task enablement and delivery results.

The Kubernetes package includes ./smoke-test.sh. Adding --with-runtime creates a test Pod and PVC to verify runtime images and storage provisioning. Run it with the required resources and permissions.

Both deployment methods accept --with-e2e during upgrade. End-to-end regression checks create temporary accounts, digital employees, and API keys and call models. They consume license slots and model quota.

Helm's --atomic handles a failed Helm deployment but does not restore application databases. Failed smoke or end-to-end checks do not trigger an automatic rollback. Kubernetes smoke check failures only generate warnings. The script may still report success, so review each failed check.

Roll back and restore ​

ConditionAction
The new version has not written to the database, and the old version supports the current configuration.Restore the previous application and configuration for the deployment method.
The database has run an incompatible migration.Stop writes. Restore the pre-upgrade database and matching configuration, then restore the old application.
Digital employee state or PVCs have been migrated.Restore the corresponding state and volume data using the migration records. Changing only the image is insufficient.

For Kubernetes, inspect the Helm release history:

bash
helm -n tego-avatar history tego-avatar

After identifying the target revision and checking data compatibility, follow the package's UPGRADE.md to run helm rollback. Before restoring a database, stop all relevant writers, including the knowledge service and digital employees. Stopping only the server leaves other services able to write.

Compose has no rollback subcommand. Use the retained package, configuration, and backup to restore the environment. Do not use uninstall --purge as a rollback step.

A restore overwrites writes made after the upgrade. Check any messages already sent and operations in external systems separately. Rolling back the application or database does not undo them.