Export and snapshots
An export is a folder of your data in the official emulator’s format. Use one to make a seed, to keep a snapshot of data you work on, or to take your data to the official emulator and back. Firenook exports Firestore, Auth and Storage.
Export while the emulators run
Section titled “Export while the emulators run”emulators:export asks the running suite to write its data to a folder:
$ npx firenook emulators:export ./exports/before-migrationFound running emulator hub for project demo-shop at http://127.0.0.1:4400; exporting firestore, auth, storage to ~/demo-shop/exports/before-migrationExport complete: ~/demo-shop/exports/before-migrationIt needs a running suite, as the official command does. With the emulators stopped, it says so:
Firenook: Did not find a running emulator hub for project demo-shop (tried http://127.0.0.1:4400): ECONNREFUSED. Start it with firenook emulators:start.The command finds the suite by its project id, through the same hub file the
official CLI uses. When two suites run with one project id, such as two Git
worktrees, it reaches the one started from the folder you run it in.
Elsewhere it asks for --hub-port; see
troubleshooting.
| Option | What it does |
|---|---|
--only firestore,auth,storage |
Exports only the services you name |
--force |
Writes into a folder that holds other files |
--json |
Prints the result as one JSON line |
-P, --project ID |
The project, when you are not in its folder |
--hub-port PORT |
The suite whose hub listens on this port, and no other |
The destination may not be the project folder, the current folder or a
parent of either. A folder that holds files but no
firebase-export-metadata.json needs --force:
Firenook: ~/demo-shop/notempty is not empty and holds no firebase-export-metadata.json; re-run with --force to overwrite its contentsA folder that already holds an export is written over without --force.
Export at the stop
Section titled “Export at the stop”--export-on-exit writes an export when you stop Firenook:
npx firenook emulators:start --import ./data --export-on-exit ./dataWithout a folder, it writes back into the --import folder, as in the
official CLI, so --import ./data --export-on-exit keeps ./data up to
date. Without --import, name the folder:
Firenook: --export-on-exit requires --import or an explicit destinationThe stop takes as long as the export, and the terminal says where it went:
19:47:00 ✓ stopped 90 ms exported to snapshotSnapshots of kept data
Section titled “Snapshots of kept data”Data kept with --keep-data is a working store, not an export. To take a
copy you can load anywhere, use any of these while the emulators run:
-
Press
ein the terminal. The snapshot goes to.firenook/exports/<date>-<time>:19:46:58 ✓ exported 25 ms .firenook/exports/2026-10-22-194658 -
Run
npx firenook emulators:export ./snapshots/todayfrom another terminal. -
In the console, the Overview’s Data card downloads a snapshot as a zip of an export, or saves it to a folder on your machine.
To write a snapshot at every stop, add --export-on-exit with a folder:
npx firenook emulators:start --keep-data --export-on-exit ./snapshotWith a seed, the folder must be another one: Firenook refuses to export into the seed it keeps data from (seeds and imports).
To go back to a snapshot later, import it into a new state folder:
npx firenook emulators:start --import ./snapshot --state-dir ./.firenook/from-snapshot --resume-stateMove data to the official emulator and back
Section titled “Move data to the official emulator and back”Firenook reads and writes the official export format. A Firenook export of 2,105 documents, one user and one file loaded in the official emulator (firebase-tools 13.4.0), and that emulator’s export loaded back into Firenook with the same counts.
-
With Firenook running, export:
npx firenook emulators:export ./export. Or stop it with--export-on-exit ./exportset. -
Stop Firenook with
qor Ctrl-C, and wait for it to exit. -
Start the official emulator on the export:
Terminal window firebase emulators:start --import ./export --export-on-exit ./export -
To come back, stop the official emulator, then start Firenook on its export:
npx firenook emulators:start --import ./export --keep-data.
Never run both at once on the same ports, and never point the official
emulator at Firenook’s .firenook/ folder: each needs its own working data.
Check how much disk your kept data takes with inspect and compact.