Firestore Database Collection Import / Export

15. Firestore Database Collection Import / Export

The product ships with a demo dataset (settings, categories, currencies, email templates, CMS pages and sample restaurants). Import it so the panels start with working defaults instead of empty screens.

15.1. Install Node.js if you have not already — see Installing Node.js & npm.

15.2. Unzip the source file named “Firebase Import Export Collections.zip”.

15.3. Create your Firebase project first if you have not — see Create Firebase Project.

15.4. Replace credentials.json in the extracted folder with the service account key you generated in step 14.11.

15.5. Open a terminal in the extracted folder. On Windows, hold Ctrl+Shift, right-click inside the folder and choose “Open PowerShell window here”.

15.6. Install the dependencies, then run the import or export command:

# Import every collection into your Firestore
npx -p node-firestore-import-export firestore-import -a credentials.json -b collections.json
# Export every collection out of your Firestore
npx -p node-firestore-import-export firestore-export -a credentials.json -b collections.json

The export writes a collections.json file you can keep as a backup.

Please note: Before running either command, make sure credentials.json holds the service-account key of the correct Firebase project. Importing into the wrong project, or importing twice, can overwrite existing documents.

See Video:

Recent Posts

    Archives

    No archives to show.

    Categories

    • No categories

    Blog Categories

    • No categories

    Archives

      Categories

      • No categories