Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Support migrate description
Browse files Browse the repository at this point in the history
  • Loading branch information
wenhuiZilliz committed Aug 19, 2024
1 parent ee7d27a commit a6deb04
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
15 changes: 14 additions & 1 deletion README_2X.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,17 @@ meta:
...
writeMode: upsert
...
```
```

If want batch migrate multi-collections, now batch migration can be achieved by passing collection name parameters through script execution in a loop (It will replace the collection name in the yaml configuration file), script like below:
```bash
#!/bin/bash

collections=("collection1" "collection2" "collection3")

for collection in "${collections[@]}"; do
echo "BatchMigration==> $collection"
./milvus-migration start -t="$collection" -c=/{YourConfigPath}/migration.yml
done
```
[BatchCollectionMigration Script](https://github.com/zilliztech/milvus-migration/blob/main/testfiles/milvus2x/batch_collection_migration.sh)
7 changes: 6 additions & 1 deletion core/transform/milvus2x/convert/milvus2x_convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ func ToMilvusParam(ctx context.Context, collCfg *milvus2xtype.CollectionCfg, mil
log.Error("milvus2x transform to custom Milvus field type error", zap.Error(err))
return nil, err
}
Description := srcCollEntity.Schema.Description
if Description == "" {
Description = "Migration from Milvus2x"
}
//collCfg.MilvusCfg.AutoId = srcCollEntity.Schema.AutoID
//log.Info("milvus2x transform to custom Milvus", zap.Any("milvusCfg AutoId", collCfg.MilvusCfg.AutoId))
//log.Info("milvus2x transform to custom Milvus", zap.Any("srcColl AutoId", srcCollEntity.Schema.AutoID))
Expand All @@ -37,7 +41,8 @@ func ToMilvusParam(ctx context.Context, collCfg *milvus2xtype.CollectionCfg, mil
ShardsNum: ToShardNum(collCfg.MilvusCfg.ShardNum, srcCollEntity),
EnableDynamicField: !collCfg.MilvusCfg.CloseDynamicField,
AutoId: collCfg.MilvusCfg.AutoId,
Description: "Migration from Milvus2x",
//Description: "Migration from Milvus2x",
Description: Description,
}
param.ConsistencyLevel, err = GetMilvusConsistencyLevel(collCfg, srcCollEntity)
if err != nil {
Expand Down

0 comments on commit a6deb04

Please sign in to comment.