Migrating a Cosmos DB fixed collection with partition key to an unlimited collection

余生颓废 提交于 2020-01-04 04:27:04

问题


I have a Cosmos DB Fixed Collection. The collection was created and utilizes a partition key.

What are the migration options from this Fixed Collection to an Unlimited Collection?

I know that I can use the Azure Cosmos DB Migration Tool to export data to JSON, then import it into a newly provisioned Unlimited Collection. Are there any other options supported by Microsoft?


回答1:


The Azure team wrote a migration tool that uses Cosmos Change Feeds and the Change Feed Processor:

https://github.com/Azure/azure-documentdb-dotnet/tree/master/samples/ChangeFeedMigrationTool

The change feed processor works by checking a lease collection. The lease collection holds a document for each of your source collection partitions. If there are no documents in this lease collection (which there won't be the first time you start the program), all documents in your source collection are considered changes.

The migration tool copies any changed document into a destination collection (DocumentFeedObserver.ProcessChangesAsync).



来源:https://stackoverflow.com/questions/48035031/migrating-a-cosmos-db-fixed-collection-with-partition-key-to-an-unlimited-collec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!