无法向 Cosmos DB 容器导入或导出大量数据

问题描述 投票:0回答:1

在我的 cosmos DB 容器中有 100,000 条记录,我使用迁移 tool 将所有记录导出到 JSON 文件中,但仅导出大约 100,000 条记录。每次我尝试下面的代码时都会导出 30K 记录

{
"Source": "cosmos-nosql",
"SourceSettings": {   
"ConnectionString" :"AccountEndpoint=<URL>;AccountKey=<AccountKey>",
"Database": "DH-PRES-DB",
"Container":"Event",
"PartitionKeyPath": "/id",
"QueryText": "Select * from c"
  },
  "Sink": "json",
  "SinkSettings": {    
  "FilePath" : "C:\\Users\\us25\\Downloads\\dmtFile\\Event_test.json"
  }
}

同样,我尝试将 JSON 导入到 cosmos 容器中,但无法导入所有记录。如果您知道这里需要修复什么,非常感谢您的帮助。

azure data-migration azure-cosmosdb-sqlapi
1个回答
0
投票

无法将大量数据导入到 Cosmos DB 容器或从 Cosmos DB 容器导出

要将数据从 Azure Cosmos DB 导出到本地计算机,您还可以使用

Azure Cosmos DB Data Migration Tool
,即使数据超过 30k,它也会导出数据。

按照以下步骤导出数据:

  • Azure Cosmos DB 容器中的数据计数: enter image description here

  • 安装

    Azure Cosmos DB Data Migration Tool
    ,单击
    Sorce Information
    并填写Azure Cosmos DB详细信息。在连接字符串中,在连接字符串的最后添加数据库详细信息并验证连接,如下所示: enter image description here

  • 现在点击

    Target Information
    ,然后在
    导出到
    处选择Json,然后选择
    Local file
    ,因为您要将其存储在本地计算机中,然后选择本地路径,然后单击
    Prettify Json
    ,如下所示: enter image description here

  • 验证

    Connection String
    Target
    并点击导入,如下图: enter image description here

  • 然后数据就会成功从Azure Cosmos DB导出到本地Json文件,如下所示: enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.