Open pascalbe-dev opened 1 year ago
Forked here https://github.com/cuong0993/node-firestore-import-export
Pass GOOGLE_CLOUD_PROJECT and FIRESTORE_EMULATOR_HOST to connect with emulator. For example,
GOOGLE_CLOUD_PROJECT=demo- FIRESTORE_EMULATOR_HOST=localhost:8089 firestore-import --backupFile db.json --yes
@cuong0993 I just tried this and it worked like a charm. Thank you for this!
When running an import for the local emulator, the data is not really imported to the firestore emulator.
Steps to reproduce the behavior
firebase emulators:start --project demo-my-project --config some-folder/firebase.json
) (a firebase.json which includes the activated firestore emulator on port 8080 is present in "some-folder")FIRESTORE_EMULATOR_HOST
environment variable tolocalhost:8080
firestore-import -y -b users.json -n users
Expected behavior
Actual behavior
I get an error message about a missing
GOOGLE_APPLICATION_CREDENTIALS
variablewhen I now point this env variable to the service account key for a different environment, the import command works (success message), but data is still not imported in the emulator.
Final thoughts
So, basically, I see two problems: