How to Import or Export Firebase Collections

Опубликовано: 04 Октябрь 2024
на канале: Siddhi InfoSoft
1,356
1

Firestore Database Collection Import Export
Step 1 = Setup NPM in your Computer
Download From URL:https://nodejs.org/en/download/

Step 2 = Extract Source Code of firestore-import-export-master.zip

Step 3 = We have to open command prompt on project folder and run command : npm install

Step 4 = Setup Firebase Project if you not created in firebase console.

Step 5 = Configure serviceAccountKey.json file. you can get from forbase Project settings
Go to --Service account -- Select Node.js -- Generate new private key
Wait untill create key this will auto download.
And Replace with current serviceAccountKey.json

Step 6 = Run command on project folder bellow import commands
All Collections are in Folder name "DataSeed"
One By one You have to run command for import each collection.
IMPORT Commands:
node import.js DataSeed/{collection name }.json
You also can check how to export collection in readme.txt file
Export commands:
node export.js {collection name}
You can use same method for import export firebase collection on all project.