Firebase/Node/React如何将文件从一个Firebase项目复制到另一个项目? [英] Firebase/Node/React How to copy files from one firebase project to another?
问题描述
我有两个Firebase项目,它们使用存储来存储文件,使用Firestore来存储元数据.一个项目用于暂存,另一个项目用于生产.我有一个简单的React应用设置,用于将我的文件和元数据上传到Staging项目.
I have a two Firebase projects using Storage to store files and Firestore for metadata. One project is for Staging and the other is for Production. I have a simple react app setup for uploading my files and metadata to the Staging project.
我试图弄清楚如何将暂存和Firestore同步到Production项目.我在Google搜索或Firebase文档方面运气不佳(除了看到您可以使用node连接到多个Firebase项目之外).
I'm trying to figure out how to sync the Staging Storage and Firestores to the Production project. I haven't had much luck with google searches or the Firebase documentation (beyond seeing that you can connect to multiple firebase projects using node).
任何帮助将不胜感激.
推荐答案
当前,对于Firestore,您将必须编写自己的代码来查询要复制的文档,然后将其添加到另一个数据库中.没有可用于简化此操作的导入/导出功能.Firestore团队正在努力使将来的工作变得更容易.
Currently, for Firestore, you will have to write your own code that queries for the documents you want to copy, then adds them to the other database. There is no import/export functionality you can use to make this easier. The Firestore team is working on making this easier in the future.
对于Cloud Storage,有一个名为 gsutil 的命令行实用程序可以进行复制文件到存储桶之间以及从存储桶中取出文件.
For Cloud Storage, there is a command line utility called gsutil that makes copying files to and from storage buckets easier.
这篇关于Firebase/Node/React如何将文件从一个Firebase项目复制到另一个项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!