If validation identifies issues with the upgrade, you can restore your previous working deployment using one of the following rollback methods.

Image-only rollback

Follow these steps to restore the previous Docker image while keeping the existing profile configuration unchanged:

  1. Stop the running profile:
    cd "$OEMCP_HOME"
    ./mcpgen stop "$PROFILE"
  2. Reload the previous image:
    # Reload previous version image
    /path/to/previous-distribution/load_images.sh
  3. Restart the profile:
    ./mcpgen start "$PROFILE"
    Verify the running container uses the previous image and repeat the known successful tool invocation.
Note: If the profile uses an explicit image reference, either restore the previous compose file or update the image reference to point to the previous version image.

Complete profile rollback

Follow these steps to restore the profile directory from backup and return the deployment to its previous working state:

  1. Stop the running profile:
    cd "$OEMCP_HOME"
    ./mcpgen stop "$PROFILE"
  2. Move the current generated profile aside for analysis:
    # Preserve the upgraded profile for analysis
    mv "generated/$PROFILE" "generated/${PROFILE}.post-upgrade"
  3. Restart the profile:
    # Restore from backup
    tar -xzf "../${PROFILE}-backup-<timestamp>.tgz"
    
    ./mcpgen start "$PROFILE"

    Verify the restored profile starts successfully and its tool catalog matches the pre-upgrade baseline.

  4. Restore the previous mcpgen wheel files:
    # Restore wheel files from the previous distribution
    cp /path/to/previous-distribution/wheels/mcpgen-*.whl "$OEMCP_HOME/wheels/"
    Note: If you removed the previous distribution, you can restore the mcpgen tooling by reinstalling from the archived distribution zip file.

Production bundle rollback

Follow these steps to restore production export artifacts and, when needed, the previous container image:

  1. Stop the production container:
    cd "$EXPORT_DIR"
    ./run.sh stop --port <port> --name <container-name>
  2. Restore the compose file:
    # Restore previous compose file
    cp docker-compose.mcp.yml.backup docker-compose.mcp.yml
  3. Reload previous image (if using latest):
    # If using :latest reference, reload previous image
    /path/to/previous-distribution/load_images.sh
  4. Restart the production container:
    ./run.sh start --port <port> --name <container-name>
Verify the production container uses the previous image and can successfully invoke authorized tools.