milvus-logo
LFAI
Home

Upgrade Milvus Cluster with Docker Compose

This topic describes how to upgrade your Milvus using Docker Compose.

In normal cases, you can upgrade Milvus by changing its image. However, you need to migrate the metadata before any upgrade from v2.1.x to v2.5.0-beta.

Upgrade Milvus by changing its image

In normal cases, you can upgrade Milvus as follows:

  1. Change the Milvus image tags in docker-compose.yaml.

    Note that you need to change the image tags for the Proxy, all coordinators, and all worker nodes.

    ...
    rootcoord:
      container_name: milvus-rootcoord
      image: milvusdb/milvus:v2.5.0-beta
    ...
    proxy:
      container_name: milvus-proxy
      image: milvusdb/milvus:v2.5.0-beta
    ...
    querycoord:
      container_name: milvus-querycoord
      image: milvusdb/milvus:v2.5.0-beta  
    ...
    querynode:
      container_name: milvus-querynode
      image: milvusdb/milvus:v2.5.0-beta
    ...
    indexcoord:
      container_name: milvus-indexcoord
      image: milvusdb/milvus:v2.5.0-beta
    ...
    indexnode:
      container_name: milvus-indexnode
      image: milvusdb/milvus:v2.5.0-beta 
    ...
    datacoord:
      container_name: milvus-datacoord
      image: milvusdb/milvus:v2.5.0-beta   
    ...
    datanode:
      container_name: milvus-datanode
      image: milvusdb/milvus:v2.5.0-beta
    
  2. Run the following commands to perform the upgrade.

    docker compose down
    docker compose up -d
    

Migrate the metadata

  1. Stop all Milvus components.

    docker stop <milvus-component-docker-container-name>
    
  2. Prepare the configuration file migrate.yaml for meta migration.

    # migration.yaml
    cmd:
      # Option: run/backup/rollback
      type: run
      runWithBackup: true
    config:
      sourceVersion: 2.1.4   # Specify your milvus version
      targetVersion: 2.5.0-beta
      backupFilePath: /tmp/migration.bak
    metastore:
      type: etcd
    etcd:
      endpoints:
        - milvus-etcd:2379  # Use the etcd container name
      rootPath: by-dev # The root path where data is stored in etcd
      metaSubPath: meta
      kvSubPath: kv
    
  3. Run the migration container.

    # Suppose your docker-compose run with the default milvus network,
    # and you put migration.yaml in the same directory with docker-compose.yaml.
    docker run --rm -it --network milvus -v $(pwd)/migration.yaml:/milvus/configs/migration.yaml milvus/meta-migration:v2.2.0 /milvus/bin/meta-migration -config=/milvus/configs/migration.yaml
    
  4. Start Milvus components again with the new Milvus image.

    Update the milvus image tag in the docker-compose.yaml
    docker compose down
    docker compose up -d
    

What’s next

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?