Firebase/Node/React How to copy files from one firebase project to another?

坚强是说给别人听的谎言 提交于 2020-01-16 15:42:12

问题


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.

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).

Any help would be appreciated.


回答1:


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.

For Cloud Storage, there is a command line utility called gsutil that makes copying files to and from storage buckets easier.



来源:https://stackoverflow.com/questions/49164571/firebase-node-react-how-to-copy-files-from-one-firebase-project-to-another

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!