【问题标题】:Transfer data from firebase firestore in one project to gcp firestore in another project将数据从一个项目中的 firebase firestore 传输到另一个项目中的 gcp firestore
【发布时间】:2022-01-27 15:26:36
【问题描述】:

我想将 Firebase 项目中 Firestore 中的数据传输到另一个(仅限 GCP)项目中的 Firestore。

这项工作的最佳解决方案是什么?

传输后文档ID会改变吗?

【问题讨论】:

    标签: firebase google-cloud-platform google-cloud-firestore


    【解决方案1】:

    项目一:

    1. Google Cloud 控制台 > firestore > 导入/导出 > 导出

    将 Firestore 数据导出到存储桶中。

    1. Google Cloud 控制台 > Cloud Storage > 选择存储桶

    下载导出的 Firestore 文件夹

    项目二:

    1. Google Cloud 控制台 > Cloud Storage > 选择存储桶

    上传导出的 Firestore 文件夹

    1. Google Cloud 控制台 > firestore > 导入/导出 > 导入

    将 firestore 数据导入存储桶。


    传输后文档ID会改变吗?

    文档 ID 未更改。

    【讨论】:

      【解决方案2】:

      要将 Cloud Firestore 数据从一个项目移动到另一个项目,您必须执行以下 4 个步骤 -

      1. 创建一个 Cloud Storage 存储分区来保存源项目中的数据

      2. 将数据从源项目导出到存储桶。

      3. 授予您的目标项目从存储桶中读取的权限。

      4. 将存储桶中的数据导入目标项目。

      目标项目中的数据与源项目中的数据保持一致,专门回答您的问题,传输后文档 ID 不会更改。

      要了解如何将 Cloud Firestore 数据从一个项目移动到另一个项目的详细过程,您可以关注this document

      【讨论】:

        【解决方案3】:

        Firebase Firestore 和 Google Cloud Firestore 是一回事。 Firebase 仅提供客户端 SDK 并具有安全规则,而 Google Cloud 主要具有服务器端 SDK。您可以查看Firebase consoleGoogle Cloud console

        也可以查看this article 了解详细信息。

        【讨论】:

        • 没错,但我想在不同项目之间传输数据
        • 原始问题中没有提到,所以不包括在内。很高兴你找到了答案:D
        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-04-02
        • 1970-01-01
        • 2021-08-19
        • 1970-01-01
        • 1970-01-01
        • 2019-07-31
        • 1970-01-01
        相关资源
        最近更新 更多