【发布时间】:2018-07-02 18:08:12
【问题描述】:
我有一个与特定帐户绑定的现有 cosmos DB。
我的问题是我是否可以使用脚本部署在另一个帐户中创建相同的 CosmosDB。
我研究过可以使用 Azure 资源管理器创建资源,但不确定如何获取现有 CosmosDB 的模板。
还有没有办法获取现有 CosmosDB 的 JSON 脚本?。
【问题讨论】:
标签: azure azure-cosmosdb azure-powershell azure-cli
我有一个与特定帐户绑定的现有 cosmos DB。
我的问题是我是否可以使用脚本部署在另一个帐户中创建相同的 CosmosDB。
我研究过可以使用 Azure 资源管理器创建资源,但不确定如何获取现有 CosmosDB 的模板。
还有没有办法获取现有 CosmosDB 的 JSON 脚本?。
【问题讨论】:
标签: azure azure-cosmosdb azure-powershell azure-cli
您实际上并没有这样的架构,您有设置和索引配置以及其他资产。
要迁移数据,请查看此工具
https://docs.microsoft.com/en-us/azure/cosmos-db/import-data
迁移数据后,只需复制并粘贴任何索引定义和其他资产(例如过程)即可。
您可能需要在迁移过程中增加 RU。
dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:TEColl /t:CosmosDBBulk /t.ConnectionString:" AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /t.Collection:TESessions /t.CollectionThroughput:2500
dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:comp1|comp2|comp3|comp4 /t:CosmosDBBulk /t.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /t.Collection:singleCollection /t.CollectionThroughput:2500
dt.exe /s:CosmosDB /s.ConnectionString:"AccountEndpoint=<CosmosDB Endpoint>;AccountKey=<CosmosDB Key>;Database=<CosmosDB Database>;" /s.Collection:StoresSub /t:JsonFile /t.File:StoresExport.json /t.Overwrite /t.CollectionThroughput:2500
【讨论】: