简体   繁体   English

将数据从 firebase 火库传输到 gcp 火库

[英]Transfer data from firebase firestore to gcp firestore

I want to transfer data from firebase firestore to gcp firestore.我想将数据从 firebase 火库传输到 gcp 火库。

What is the best solution for the this work?这项工作的最佳解决方案是什么?

Does the document ID change after transfer?转移后文件ID是否会改变?

Project one:项目一:

  1. Google Cloud console > firestore > Import/Export > Export谷歌云控制台 > firestore > 导入/导出 > 导出

get a export the firestore data into the Storage bucket.将 Firestore 数据导出到存储桶中。

  1. Google Cloud console > Cloud Storage > select bucket谷歌云控制台 > 云存储 > select 存储桶

download the export firestore folder下载导出 Firestore 文件夹

Project two:项目二:

  1. Google Cloud console > Cloud Storage > select bucket谷歌云控制台 > 云存储 > select 存储桶

upload the export firestore folder上传导出 Firestore 文件夹

  1. Google Cloud console > firestore > Import/Export > Import谷歌云控制台 > firestore > 导入/导出 > 导入

import the firestore data into the Storage bucket.将 firestore 数据导入 Storage 存储桶。


Does the document ID change after transfer?转移后文件ID是否会改变?

Documents ID did not change.文档 ID 未更改。

Firebase Firestore and Google Cloud Firestore are the same thing. Firebase Firestore 和 Google Cloud Firestore 是一回事。 Firebase just provided client SDK and has security rules while Google Cloud mostly has server side SDKs. Firebase 只是提供了客户端 SDK 并且有安全规则,而谷歌云主要有服务器端 SDK。 You can view the both Firebase console and Google Cloud console .您可以查看Firebase 控制台Google Cloud 控制台

Also checkout this article for detailed information.另请查看本文以获取详细信息。

To move Cloud Firestore data from one project to another project you have to follow the following 4 steps -要将 Cloud Firestore 数据从一个项目移动到另一个项目,您必须执行以下 4 个步骤 -

  1. Create a Cloud Storage bucket to hold the data from your source project创建一个 Cloud Storage 存储分区来保存源项目中的数据

  2. Export the data from your source project to the bucket.将数据从源项目导出到存储桶。

  3. Give your destination project permission to read from the bucket.授予您的目标项目从存储桶中读取的权限。

  4. Import the data from the bucket into your destination project.将存储桶中的数据导入目标项目。

The data in the destination project remains as it is in the source project and specifically to answer your question, the document ID does not change after transfer.目标项目中的数据与源项目中的数据保持一致,特别是为了回答您的问题,传输后文档 ID 不会更改。

To know the detailed process on how to move Cloud Firestore data from one project to another project you can follow this document .要了解如何将 Cloud Firestore 数据从一个项目移动到另一个项目的详细过程,您可以按照此文档进行操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM