【问题标题】:Restoring part of firestore export恢复部分 Firestore 导出
【发布时间】:2021-02-26 07:36:27
【问题描述】:

我正在跟进以下文档:

https://cloud.google.com/sdk/gcloud/reference/firestore/import

我正在尝试从今天开始在备份中恢复集合 pets。但是我得到了这个:

# gcloud firestore import gs://pets-backup/2021-02-26T02:27:05_54372/ --collection-ids='pets'
ERROR: (gcloud.firestore.import) INVALID_ARGUMENT: The requested kinds/namespaces are not available

我可以确认gs-bucket 存在并且集合pets 也存在。

这个错误不是很有帮助,我不确定我在处理什么。

我注意到在导出中,有文件夹/all_namespaces/all_kinds。当我尝试直接从这些导入时,我得到:

gcloud firestore import 'gs://pets-backup/2021-02-26T02:27:05_54372/all_namespaces/all_kinds' --collection-ids='pets'
ERROR: (gcloud.firestore.import) NOT_FOUND: Google Cloud Storage file does not exist: /pets-backup/2021-02-26T02:27:05_54372/all_namespaces/all_kinds/all_kinds.overall_export_metadata

我可以看到只有一个文件 all_namespaces_all_kinds.export_metadata 与导入工具正在查找的文件不匹配。

【问题讨论】:

  • 您尝试从所有集合的导出中提取此集合的导出?正如您在 documentation 中看到的那样,这是不可能的。
  • 不幸的是,是的。这真的不切实际:/

标签: google-cloud-firestore gcloud google-cloud-sdk


【解决方案1】:

正如您在 cmets 中所确认的,您正在尝试从所有集合中提取和导出集合。不幸的是,目前这是不可能的,正如您在 documentation 中看到的那样:

只有特定集合组的导出支持特定集合组的导入。您不能从所有文档的导出中导入特定集合。

如果您希望对此进行更改,您可以在Google's Issue Tracker 提交功能请求,以便他们考虑实现此功能。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-30
    • 1970-01-01
    • 1970-01-01
    • 2011-06-15
    • 1970-01-01
    相关资源
    最近更新 更多