Realtime Database

Since v2.3.0

Export, import and bulk jobs

Every plan exports a node or a whole Realtime Database to JSON, JSON Lines, CSV or YAML. Individual, Team and the Lifetime Deal also import files and run jobs that copy, move, rename, delete or update many children in the background, each reviewed before it starts.

What the jobs do

Fuego runs large operations—exporting a big node, importing a file, or changing thousands of children—as background jobs in the activities panel while you keep working.

JobWhat it doesPlans
ExportWrites a node, selected children, a query’s children or a whole database to a fileEvery plan (advanced query ranges/last limits need a paid plan)
ImportWrites the children of a JSON or JSON Lines file into a nodePaid plans
Copy, move, renameCopies or moves a node or selected children, in the same database or into another onePaid plans
DeleteDeletes a large node, many rows or the children matching a query, in small stepsPaid plans
Update childrenChanges the same members in every child of a nodePaid plans
  • Who a job runs as. Always Admin, even when started from a tab that reads as a user.
  • What stops a job that writes: a path or database made read-only in Fuego, a project kept read-only in Fuego, a read-only team sublicense, or an unverified database synced from another computer.

Where to start a job

WhereWhat it offers
A node’s Actions menu (right-click)Export…, Import here…, Update children…, plus Rename key…, Move to…, Copy to… and Delete… (which run as a job when large)
The tab’s Tools menuExport… (node, query or selection), Import…, Update children…, Delete matching children…
The selection menu, Selected: {count}Export {count}…, Copy {count} to…, Move {count} to…, Update {count}… and Delete {count}…
The database menuExport database… and Copy database to…
The command paletteRealtime Database: export this node… and Realtime Database: import into this node…

Export

The export dialog asks for:

  • What it covers: The whole node {path}, Selected children: {count} or The children matching the query.
  • Format: JSON, JSON Lines, CSV (with Comma, Semicolon, Tab or Vertical bar separator) or YAML.
  • Keep priorities (JSON and JSON Lines, on by default): writes each priority with its value, just like the Firebase console, so the file can be imported back as is.
  • Anonymize the data: masks values before any script runs and before writing them to disk (Anonymization).
  • File and optional Transform each child with a script (Scripts).

Small nodes are exported in a single read; larger nodes are read in parts, so their export is not a point-in-time snapshot. Until it finishes, the export writes to a .fuego-partial file and never overwrites a target file that changed while the export was running. From a terminal, fuego rtdb export runs the same export (Command line).

Import

Choose Import here… in a node’s Actions menu or Import… in Tools:

  • File: a JSON or JSON Lines (.jsonl / .ndjson) export from Fuego, the Firebase console or the Firebase CLI.
  • Preview before writing: Fuego scans the file locally and shows its child count, size, depth, arrays converted to numbered-key objects, and any server timestamps or increments (increments are applied at most once and never retried after an unclear network failure).
  • Null values: ignored by default; turn on Delete the children the file sets to null to delete those keys at the destination instead.
  • Invalid children (invalid keys, depth over 32 levels, path over 768 bytes or value over 10 MB) are listed with their line and column; fix the file or check Skip the invalid children: {count} to proceed.

Copy, move and rename

A small node copied, moved or renamed within the same database is written in one request (Edit data). It runs as a background job (Copy / Move / Rename as an activity) when the node is large, when it targets another database, project or emulator, when operating on multiple selected rows, or when merging into an existing destination without replacing it whole.

  • A copy or move job works child by child (not atomic, and not a point-in-time copy on large nodes).
  • In a move job, source children are deleted only after their copy is confirmed; children added at the source meanwhile are kept.

When the destination already holds data

Import, copy, move and rename let you choose how to handle existing data at the destination:

  • Replace the copied children, keep the others (the default).
  • Replace the whole destination: deletes any other children at the destination once the copy finishes.
  • Skip the children it already has (import and copy only).

Delete many children

A delete runs as a background job (Delete as an activity) for a node of 10,000 children or more, for more than 1,000 selected rows, when the database refuses a single-request delete, and always for Delete matching children…. It deletes in small steps so the database keeps serving your app, and can be paused and resumed.

Update children

Update children… (or Update {count}…) changes every child of a node, a selection or a query the same way, using either Changes or a Custom script (Scripts).

With Changes, add up to 100 operations per child on a Path inside each child (such as profile/name):

  • Set a typed or JSON value;
  • Delete the member or the child itself;
  • Rename to a new path inside the child;
  • Server timestamp;
  • Increment by a number (applied at most once per child).

Skip children deleted meanwhile (on by default) avoids recreating a child that was deleted while the job ran. The dialog previews Before and after, first children before you start.

Database triggers

Every job that writes (import, copy, move, rename, delete, update) offers the switch Ask Firebase not to run database triggers (Cloud Functions) for these writes (“Firebase accepts this request; whether the triggers stay silent has not been confirmed yet.”). It defaults to on for imports, and remembers your last choice per database for the other jobs.

Before a job starts

Each dialog previews how many children the job covers, how the source is read (at once or in parts), and what the destination holds. Destructive jobs ask for confirmation (or typing the node’s key / database name for large removals), and a job cannot start while another active job is writing to the same path.

Scripts

Export, import and update jobs can run a custom JavaScript function on each child, using the editor, test runner (on the first 10 children with writes disabled) and library of Custom scripts:

  • Export / Import: receive key, path, value, rtdb.get(), fetch, util; return the transformed value, or undefined to skip the child.
  • Update: also receives rtdb.update(); return an object with the changed members (null deletes a member or the child, undefined leaves the child untouched).

Follow and restart a job

A job’s card in the activities panel shows the children read, written and deleted, any errors or uncertain writes, and the bytes downloaded and uploaded, with Pause activity, Resume activity and Cancel activity.

If a job fails, is stopped, or is interrupted when Fuego closes, its card stays in the panel so you can click Restart activity:

  • Continue (or Continue after {path}): resumes from the last confirmed child so completed writes are not repeated.
  • Start over: runs from the beginning as a new activity. Not offered for non-idempotent jobs (increments, import/update scripts) or jobs that mutate what they read (move, rename, or a query with a limit).
  • Run again: runs a completed job again on the current database state.

Save settings and macros

  • Save settings (in export, import and update dialogs) remembers the dialog’s options for the node or database (excluding file paths and scripts).
  • Save as macro (in export and update dialogs) saves the job to run again from the command palette or Manage macros… on this node, any node of this database, or any database of the project.