I created a Google Cloud account and have everything setup but for some reason I can't figure out how to export my Firestore data to a "file" edit/add to that file and re-upload.
I'm read through this several times: https://firebase.google.com/docs/firestore/manage-data/export-import#import_specific_collections
No code but just real confusion. I am not sure how to export a collection so that I can make bulk edits.
You can use gcloud cli to export to a cloud store bucket
gcloud beta firestore export gs://[BUCKET_NAME]
To export to a local file, you can use the REST API
POST https://firestore.googleapis.com/v1beta1/{name=projects/*/databases/*}:exportDocuments
There is also an npm app which can do this, node-firestore-import-export.
firestore-export --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json
firestore-import --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json
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