Whats the preferred way to backup an entire firestore database automatically on a schedule that would allow for a manual restore
Asked Answered
L

2

6

New to Firestore, really enjoy using it but the one issue I have is that I can't see an obvious way to backup the entire database for a given project, the idea being that if anything goes wrong I can overwrite the nodes with the backup.

Lustrum answered 23/8, 2022 at 8:40 Comment(0)
S
10

In the Realtime Database, you can back up your data by simply exporting it from the Firebase Console. However, for Firestore, you have to use Google Cloud Console. Here are the docs:

If you need to schedule that operation, it's recommended to use Cloud Functions for Firebase as explained here:

Seashore answered 23/8, 2022 at 8:56 Comment(4)
Hey Jeff. Can I help you with other information?Seashore
The top link is no longer valid I think.Antoninaantonino
@ShaunRamsey I just checked and it is still valid.Seashore
So it seems it is! I tried to go to it 3 times and got "Service Unavailable." However, with a few refreshes and trying different browsers it comes right up. It makes me wonder how many times this has happened to me and I gave up on valid documentation because this has happened to me a lot in the firebase websites. Thanks for the confirmation!Antoninaantonino
S
1

There's a new way to automatically setup and schedule your Firestore backups using gcloud.

I also published a blog post on how you can use the Python discovery client to achieve the same programatically.

Scaler answered 28/4 at 19:50 Comment(1)
This option is indeed great, but the document doesn't have specific section to select "collectionIDs" whereas scheduled data export allows us to do so.Chemesh

© 2022 - 2024 — McMap. All rights reserved.