Data safety
Firestore point-in-time recovery without scripts
Browse the history of any document, compare past versions with the current one, and restore a single document or a whole set of query results to how they were minutes or days ago.
Quick answer
How do you restore a Firestore document to an earlier version?
Firestore keeps past versions of your documents through point-in-time recovery (PITR): the last hour on every database, and 7 days at one version per minute once you enable PITR. Natively, you read those versions with a server client library or the REST API at a chosen read time and write the data back yourself, or you clone the whole database at a timestamp.
Fuego puts the same history in a window: pick a moment, compare it with the current document, and restore one document or many in a few clicks.
One version per minute
Off by default
Billed storage
Sources: Firestore documentation on point-in-time recovery and using PITR.
What Fuego adds
Point-in-time recovery features in Fuego
Document history
Side-by-side comparison
Restore in one click
Read-time queries
Load differences
Bulk restore
A read time is a setting of the query itself, so it combines with filters and sorting in the query builder. Restores of many documents run as background tasks, like the other bulk operations.
Workflow
How to restore Firestore data with Fuego
There are two ways: one document from its context menu, or many documents from a query at a read time.
Restore one document
-
Find the document
Open the collection in the database viewer and locate the document you want to restore.
-
Open its history
Right-click the document, or open its context menu, and choose PITR. A history panel shows the available versions.
-
Compare versions
Select a timestamp to view that version and compare it with the current document.
-
Restore the version
Click Restore version and confirm. The document reverts to the state it had at that moment.
Restore many documents with a read time
-
Set a read time
Open the collection or query and set its read time with the clock button in the toolbar. The table shows the documents as they existed at that moment.
-
Review the changes
Turn on Load differences to highlight what changed, and compare each document with its current version.
-
Select documents
Select the documents you want to bring back, or keep the whole result set.
-
Restore and confirm
Open Actions, choose Restore (PITR) for all results or only the selected documents, and confirm.
Both flows are covered step by step, with animations, in the Point in Time Recovery docs and in the PITR walkthrough on the blog.
Use cases
When point-in-time recovery helps
Undo a bad write
Bring back deleted documents
Find out what changed
Rehearse on the emulator
Good to know
Limits and things to know
In Firestore
- Enable PITR before you need it. Without it you only have the last hour, and enabling it never recovers anything older than one hour before you did.
- Seven days is the ceiling. For older data, keep regular copies: Firestore scheduled backups can be retained for up to 14 weeks and are restored into a new database, or you can export collections to JSON with Fuego.
- Reading needs server code. Natively, past versions are read with the server client libraries (Go, Java, Node.js and PHP, inside a read-only transaction) or the REST API; the Android, iOS and Web SDKs are not supported.
In Fuego
- A restore is a write. Fuego writes the past version over the live document. It never deletes documents that were created after the read time.
- Emulator history starts with the emulator. Earlier versions, imported data included, are not available, and Open collection at this date is not offered there. See PITR on the emulator and Emulators.
- Also in the terminal.
fuego doc get <path> --at <time>prints a document as it was at a past moment. See the command line docs. - Plans. Point-in-time recovery is part of the Individual, Team and Lifetime Deal plans, not the Free plan. Compare them on the pricing page.
FAQ
Frequently asked questions
How long does Firestore keep point-in-time recovery data?
With PITR enabled, Firestore keeps one version per minute for 7 days; with PITR disabled, only the last hour. Right after you enable PITR, the earliest readable version is one hour before you enabled it, and the full 7-day window builds up over the following week.
Do I need to enable PITR before I can use it in Fuego?
Not for the last hour, which every Firestore database keeps. To go back further, enable PITR on the database under Disaster Recovery in the Google Cloud console, or with gcloud. When PITR is off, Fuego's read-time picker tells you and links to the database's Disaster Recovery settings in the Firebase console. PITR storage has no free tier, so billing must be enabled.
Can I restore a deleted Firestore document?
Yes, if it was deleted within the recovery window. Set a read time from before the deletion and the document appears in the results as it was then. Select it and restore it, and Fuego writes it back to the same path.
Can Fuego restore an entire Firestore database?
Fuego restores documents in place: one document, a selection, or all the results of a read-time query. To recreate a whole database as it was at a given minute, Firestore clones it into a new database with the gcloud firestore databases clone command.
Does point-in-time recovery work with the Firestore emulator?
Yes, since Fuego 2.2: document history, version comparison, restores and read-time queries all work on emulator projects. History starts when the emulator starts, and Open collection at this date is not offered there.
Which Fuego plans include point-in-time recovery?
Point-in-time recovery is included in the Individual, Team and Lifetime Deal plans, and in the Individual plan's 14-day free trial. The Free plan does not include it.
Get started
Recover Firestore data visually
Download Fuego, connect your project and open any document's history. Point-in-time recovery is included in the paid plans and in the 14-day free trial.
