Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to export Firestore database

I am trying out the new export feature of the FireStore as shown on this link, and I keep getting error message:

gcloud alpha firestore export gs://backup --async

ERROR: (gcloud.alpha.firestore.export) PERMISSION_DENIED: Service account does not have access to Google Cloud Storage file: /backup. See https://cloud.google.com/datastore/docs/export-import-entities#permissions for a list of permissions needed. Error details: [email protected] does not have storage.buckets.get access to backup.

I've run the command to add my service account as a storage.admin, and that command succeed:

gcloud projects add-iam-policy-binding projectABC --member='serviceAccount: [email protected]' --role='roles/storage.admin'

Could someone help?

like image 224
Natural Lam Avatar asked Aug 14 '18 06:08

Natural Lam


People also ask

How do I export data from Firebase emulator?

The export directory can be specified with this flag: firebase emulators:start --export-on-exit=./saved-data . If --import is used, the export path defaults to the same; for example: firebase emulators:start --import=./data-path --export-on-exit .

What is the correct command line structure to export data from Datastore?

Use the gcloud datastore export command to export all entities in your database. where bucket-name is the name of your Cloud Storage bucket and an optional prefix, for example, bucket-name /datastore-exports/export-name . You cannot re-use the same prefix for another export operation.


1 Answers

You can't select an arbitrary bucket name for your backup. You're using "gs://backup". Instead, you need to use the url for an actual bucket that you've created an you fully control.

like image 142
Doug Stevenson Avatar answered Oct 22 '22 00:10

Doug Stevenson