简体   繁体   English

如何将数据从 Firebase Firestore 模拟器导出到实际的 Firebase Firestore 数据库

[英]How to export data from Firebase Firestore emulator to actual Firebase Firestore database

Scenario:设想:

I am working on a POC locally where I am using Firestore as my database.我在本地处理 POC,我使用 Firestore 作为我的数据库。 As it is my local setup I am using Firestore Emulator.因为这是我的本地设置,所以我使用的是 Firestore 模拟器。 Now my POC is successful and I want to move local database from emulator to actual Firestore.现在我的 POC 成功了,我想将本地数据库从模拟器移动到实际的 Firestore。

Query:询问:

Is it possible to achieve what I am trying to do?是否有可能实现我想要做的事情?

So far I am not able to find any relevant content on inte.net around this.到目前为止,我无法在 inte.net 上找到与此相关的任何内容。 I did find couple of examples where there is demonstration of exporting data from Firestore and importing to local emulator but I was not able to find the vice-versa option!我确实找到了几个示例,其中演示了从 Firestore 导出数据并导入到本地模拟器,但我找不到反之亦然的选项!

Firebase does not provide any sort of tool or service to do this. Firebase 不提供任何类型的工具或服务来执行此操作。 Your easiest alternative will be to write a program to query the data out of the emulator and write it into your cloud hosted instance.您最简单的选择是编写一个程序来查询模拟器外的数据并将其写入您的云托管实例。 You might find the Firebase Admin SDK helpful for writing to the cloud in a program that you run locally.您可能会发现 Firebase Admin SDK 有助于在本地运行的程序中写入云。

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

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