Milvus 2.2 has changed the meta structure for segment index. If you have installed a milvus cluster of version v2.1.x, you'd run this script to migrate the meta and upgrade the milvus image version.
> Note:
> 1. This script only works with Milvus installed on k8s cluster.
> By default, the script only migrate from v2.1.x to v2.2.x. If there is anything wrong, you'd first rollback to the older version using the `rollback` operation.
## Migrate Procedures
The migration will take four steps:
1. Stop the milvus components; if there are any live session in milvus etcd, the migration will fail.
2. Backup the milvus meta;
3. Migrate the milvus meta;
4. Startup milvus components with provided new image;
> Note:
> 1. if step 1) or 2) are failed, you can rerun the migration again
> 2. if step 3) or 4) are failed, you'd first rollback and migrate again
## Usage
1. Milvus instance name, milvus source version, milvus target vresion are required to be specified.
```shell
./migrate.sh -i my-release -s 2.1.1 -t 2.2.0
```
2. If your milvus is not installed in the k8s default namespace, please specify namespace with `-n`.