You can restore Google Cloud Firestore content to recover from deletion or corruption. You can restore content to the same location (in place) or to a different Google Cloud Firestore database (out of place).
Restore destinations
| Destination | When to use |
|---|---|
| In place | Recovering from accidental deletion, corruption, or ransomware on the original Google Cloud Firestore database |
| Out of place | Migration, disaster recovery to a new database, or restoring to a test or sandbox database |
Permissions and prerequisites
For out-of-place restore to a different GCP project or database:
-
The target Firestore database must be pre-created in the destination GCP project. The workload does not create Firestore databases.
-
The Service Account must have
roles/datastore.importExportAdminandroles/storage.objectAdminpermissions on both the source (for reading backup data) and destination (for importing data) projects. -
The original GCS bucket where the backup was stored must remain accessible during restore.
You can restore Google Cloud Firestore content to the original location.
-
From the Command Center navigation pane, go to Protect > AI & Analytics.
-
Click the Google Cloud Firestore configuration.
-
On the Instances tab, click the action button
, and then click Restore. -
Select the recovery point (backup job) to restore from.
-
Select the collections to restore. To restore all collections, select the database level.
-
Verify that the restore destination is set to In place (same database).
-
Click Submit.
-
Monitor the restore job progress in the Jobs view.
You can restore Google Cloud Firestore content to a different Google Cloud Firestore database and a path other than the original backup location.
-
From the Command Center navigation pane, go to Protect > AI & Analytics.
-
Click the Google Cloud Firestore configuration.
-
On the Instances tab, click the action button
, and then click Restore. -
Select the recovery point (backup job) to restore from.
-
Select the collections to restore. To restore all collections, select the database level.
-
Select Out of place.
-
In the Destination project field, enter the target GCP project ID.
-
In the Destination database field, enter the target Firestore database name. This database must exist in the destination project.
-
Click Submit.
-
Monitor the restore job progress in the Jobs view.
Restore proceeds in parent-first order:
-
Collection data is restored first using Firestore
importDocumentsAPI (one import operation per collection or one combined import for all collections, depending on granular mode) -
Composite indexes are restored after all collection data is imported
-
If a composite index already exists in the destination database, the HTTP 409 error is silently skipped
Restore notes
-
Document
create_timeandupdate_timefields are managed by Firestore and are not restored from the backup. These fields are set to the restore time. -
Existing documents with the same document ID are overwritten by the restore operation (upsert behavior).
-
The restore uses the backup path stored in the job metadata to locate the GCS export prefix, so the original GCS bucket must remain accessible during restore.
-
Firestore allows only 1 concurrent export or import operation per database at a time. If an import operation is already running on the destination database, the restore job waits or fails.