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

[Enhancement]:When migrating, the metadata IDs are automatically generated. However, it is expected that in the new data, instead of using automatically generated IDs, the old metadata IDs should be retained. #95

Open
mmahao opened this issue Aug 19, 2024 · 7 comments

Comments

@mmahao
Copy link

mmahao commented Aug 19, 2024

What would you like to be added?

When migrating, the metadata IDs are automatically generated. However, it is expected that in the new data, instead of using automatically generated IDs, the old metadata IDs should be retained.

Why is this needed?

We are currently using Milvus version 2.2.16 and want to upgrade to 2.4.8. I have strongly associated the primary key ID of Milvus with MySQL, but when using the migration tool, I noticed that the IDs are not the same as the old metadata primary key IDs, which could cause problems. The current plan is to set up a new 2.2.16 instance, migrate the data from the current 2.2.16 instance to the new one using the migration tool, and then follow the steps in the official documentation (‘https://milvus.io/docs/upgrade_milvus_standalone-operator.md#Conduct-a-rolling-upgrade’) to perform a rolling upgrade. This approach aims to ensure a smooth upgrade from 2.2.16 to 2.4.8 in the production environment.

Anything else?

I hope the indexes and descriptions can be synchronized as well.

@mmahao
Copy link
Author

mmahao commented Aug 19, 2024

Also, it would be great if a batch migration tool could be implemented.

@wenhuiZilliz
Copy link
Collaborator

@mmahao

  1. about ID(primary key) , when your target Milvus AutoId property is open, then source Milvus collection's ID will not be target collection ID, it's determined by Milvus' characteristics. If your target collection not exists then the migration tool will create it and the collection structure same with source collection, so if source collection open AutoId feature then target collection as well. Now the fastest solution is manually create target collection and close AutoID feature. (if target collection already exists migration tool will skip create it) that will let source collection ID as the target collection's ID.

  2. are you means is want migration multi-collections(batch migration) ? if yes, you can write a bash script like below: (Loop passes the collection to be migrated to parameter - t)

#!/bin/bash

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

for collection in "${collections[@]}"; do
echo "BatchMigration==> $collection"
./milvus-migration start -t="$collection" -c=/{YourConfigPath}/migration.yml
done

https://github.com/zilliztech/milvus-migration/blob/main/testfiles/milvus2x/batch_collection_migration.sh

@wenhuiZilliz
Copy link
Collaborator

@mmahao use latest code it supported migration collection description, but we don't want support create index (create index is relatively independent time-consuming operations, hope to do it alone )

@xiaofan-luan
Copy link
Collaborator

@wenhuiZilliz how long does it take to use VTS to support this?

@wenhuiZilliz
Copy link
Collaborator

@xiaofan-luan VTS internal migration tool currently supports batch collections and whether AutoId features are enabled

@breadmakerQQQ
Copy link

breadmakerQQQ commented Aug 21, 2024

Same situation occurred... When migrating, the old data's ids are unretained, however, if I handly create a new collection and make it auto_id disabled as suggested, the new following data cannot be insert since I didn't specify a id by myself in program... And it seems Milvus does not support modification on schema include auto_id property, so if I want to make a collection auto_id enabled from disabled, I need to migrate again from a none auto_id collection to auto_id one, which make ids unretained still, what a mess...

@wenhuiZilliz
Copy link
Collaborator

wenhuiZilliz commented Aug 21, 2024

@breadmakerQQQ however I don't know your scene,but if you want source collection(enable autoId) to target collection(enable autoId), and copy the ids of the existing source collection to the target that this tool cannot achieve it(that need target collection disable autoId), but you can use our another tool the milvus-backup that use backup/restore data ability to achieve your requirement. see: https://github.com/zilliztech/milvus-backup

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants