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
I have looked at firestore-export-import
and node-firestore-backup
to do the backup and export the data to a JSON file.
My questions are:
Any help, no matter how small would be appreciated.
Thanks
As of today, Firestore does not support automatic backups, but it DOES support exports via the gcloud CLI or REST API. Although not technically a backup in database jargon, an automatic export is valuable to have for disaster recovery because it can be re-imported to replace lost data.
☝️ We assume that you are an owner of the Firebase project and that you have enabled billing. Read more here. The Firestore backups are initiated by a cloud function and are stored in a dedicated storage bucket on Google Cloud Platform.
Cloud Firestore supports offline data persistence. This feature caches a copy of the Cloud Firestore data that your app is actively using, so your app can access the data when the device is offline. You can write, read, listen to, and query the cached data.
You can now export and import the data to the specified bucket.
More info here: 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/schedule-export
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With