DEV Community

Cover image for How to Use the Firestore Export API Before it is Released

How to Use the Firestore Export API Before it is Released

Christian Alexander on July 20, 2018

TL;DR Check out FirestoreRestore. It uses a brand new API to backup and restore your Firestore database! Background There hav...
Collapse
 
dustinsoftware profile image
masters.🤔

Thanks for the write up. How hard would it be to leverage this API to do offsite backups (in case you wanted to migrate somewhere else for instance)

Collapse
 
christianalexander profile image
Christian Alexander

Thanks for the question! It should be trivial to download the export files from the storage bucket and store them elsewhere. I'm not sure if the API would support an external destination directly (S3, for instance), but my guess is that gs:// URLs are the only supported destinations.

Migration may be a bigger issue. It appears that the files generated by this API are in the same format as Google Cloud Datastore entity exports, which appear to be proprietary. The decision to use Firebase comes with a ton of vendor lock-in, so this is not surprising.

If anyone is looking to export their data for use in another system, one of the tree traversal scripts found on NPM would likely be their best bet. Most of them are capable of producing JSON files that could be consumed by other systems.

Collapse
 
newmesiss profile image
Luis Ruiz

Do you know if it is now possible to download the entire folder created when exporting? to save it on my computer

Collapse
 
christianalexander profile image
Christian Alexander

The files should be downloadable from the Google Cloud Storage bucket. I'm not sure about the file format or how to use the data after downloading.