Home / Features / Compare and migrate
Compare and migrate
Compare Firestore collections and databases, then migrate staging to production
See exactly what differs between two collections, two databases or two projects, document by document, and bring over only what you choose: copied differences, or a whole migration of documents, indexes, rules and users, previewed first.
Why it matters
Staging and production drift apart
A test document left behind, a field renamed in one place but not the other, an index someone made by hand in the console: over time two environments stop matching, and a release that worked in staging breaks in production. Firetool reads both sides and shows the differences in plain terms, so you can decide what to fix. Comparing only reads and works in the Free edition; copying and migrating write, and need Pro.
Compare collections
One collection against another
Right-click a collection and choose Compare with…, then pick the other project, database or path. Firetool counts both sides first, asks before reading more than your limit, and matches the documents by ID.
- Only in A, only in B, different (with the fields that differ) and the same
- Both versions of a document side by side, values compared exactly as stored
- Copy the differences you tick, A → B or B → A, optionally deleting what's only on the side you write to
- A document someone changed after the comparison is never overwritten

Migrate environments
Bring staging into production, previewed first
Tools → Migrate environments… brings documents (with subcollections, references pointed at the new place), indexes, Firestore security rules and Authentication users from one database into another.
- Preview only reads, and lists every document to create or replace, the indexes and users to create and whether the rules change
- Run migration writes exactly that, as one job you can pause, cancel and undo
- A document changed in the target since the preview is skipped, never overwritten
- Nothing in the target is deleted, and masked environments stay masked

Compare databases
Two whole databases, collection by collection
Counts first
Tools → Compare databases… lists every top-level collection with its document count on each side, using count queries that cost little, and marks the ones only on one side.
Then the documents
Tick the collections to look at closely: each gets its documents only in A, only in B, different and the same, with subcollections. Only a page of each side is held, so big databases don't fill your computer's memory.
Reads only
It runs in Tasks with Pause, Resume and Cancel, and never writes. The Schema tab, security rules and Authentication settings compare between environments too. Compare databases
How it works
From drift to a fix in three steps
Compare
Pick A and B: two collections, two databases, or two projects such as staging and production. Firetool counts first and shows the reads and cost of anything big.
Look
Filter to what's only on one side or different, and open any document to see both versions field by field.
Fix
Copy the differences you tick, or run a migration. Your role, the target's production and read-only rules and the audit log apply to every write.
In CI, firetool compare and firetool indexes diff end with exit code 6 when two databases differ, and firetool transfer copies only what's missing or different. The firetool command
Questions
Compare and migrate questions
How many reads does a comparison cost?
Counting collections uses count queries, which cost little. Comparing documents reads every document on both sides, one read each. Firetool counts first and asks before reading more than 10,000 documents (a number you can change in Settings), with the estimated cost.
Does comparing need Pro?
No. Comparing collections, databases, schemas, security rules and Authentication settings only reads, and works in the Free edition. Copying differences and Migrate environments write, so they need Pro (the 30-day trial includes it).
Can a migration delete documents in production?
No. Migrate environments only creates and replaces. Documents only in the target are listed and left as they are, and the whole migration is one operation you can undo from Tasks or the audit log.
Are subcollections compared?
Compare databases and Migrate environments include subcollections (you can leave them out). Compare collections looks at the documents of the collection you choose; type a subcollection's path, such as users/alice/orders, to compare it.
Related
More you can do with Firetool
Data transfer
Copy, move and duplicate collections and databases between projects.
Learn more →Backup and restore
A copy you can hold before a risky change, restored in full or in part.
Learn more →Security rules editor
Compare rules between projects, test them and deploy with the old ones kept.
Learn more →Try it on your own data
Free for Windows, macOS and Linux, with every Pro feature for the first 30 days.