如何每天自动备份Firestore数据库 [英] How to automatically backup Firestore database daily

查看:66
本文介绍了如何每天自动备份Firestore数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想每天备份一个Firestore数据库.

I would like to backup a Firestore database on a daily basis.

我的数据结构是这样的:

My data structure is like this:

usersCollection
  uid
     defaultCurrency: 'USD'
     name: 'something'
     dreamsCollection
                     name
                     image

我查看了firestore-export-importnode-firestore-backup进行备份并将数据导出到JSON文件.

I have looked at firestore-export-import and node-firestore-backup to do the backup and export the data to a JSON file.

我的问题是:

  1. 如果我创建云功能,如何每天运行云功能?
  2. 进行备份的最佳方法是什么?
    • 我应该将数据存储在Firebase存储中吗?
    • 我应该将JSON保存到单独的服务中吗?
  1. If I create a cloud function how do I run the cloud function daily?
  2. What is the best way to do the backup?
    • Should I store the data in firebase storage and how to do this?
    • Should I save the JSON to a separate service etc?

任何帮助,无论能得到多大的帮助.

Any help, no matter how small would be appreciated.

谢谢

推荐答案

您现在可以将数据导出并将其导入到指定的存储桶中.

You can now export and import the data to the specified bucket.

此处的更多信息: https://firebase.google.com/docs/firestore/manage-data/export-import

以下是有关如何自动执行的信息:

Here is an info on how to do it automatically:

https://firebase.google.com/docs/firestore/solutions/计划导出

这篇关于如何每天自动备份Firestore数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆