Restoring Data
Data restoration is a critical capability of FireBackup. This guide covers how to restore from backups, preview data before restoration, and handle various restore scenarios.
Restore Overview
FireBackup supports multiple restore scenarios:
| Scenario | Description | Method |
|---|---|---|
| Full Restore | Restore entire backup to project | Standard restore |
| Selective Restore | Restore specific collections | Collection filter |
| Point-in-Time | Restore to a specific timestamp | PITR restore |
| Cross-Project | Restore to different project | Target override |
| Preview | View data before restoring | Preview mode |
Prerequisites
Before restoring data:
- Valid backup - Backup must be verified and accessible
- Target project access - OAuth token or service account with write access
- Sufficient IAM permissions -
roles/datastore.importExportAdminon target - Encryption key - If backup is encrypted
Restoring data will overwrite existing documents with matching IDs. This operation cannot be undone. Always preview and verify before restoring to production.
Restoring from a Backup
Step 1: Select Backup
- Navigate to Backups in the sidebar
- Find the backup you want to restore
- Click Restore in the actions menu
Step 2: Choose Restore Mode
| Mode | Description | Use Case |
|---|---|---|
| Full Restore | Restore all collections | Complete recovery |
| Selective Restore | Choose specific collections | Partial recovery |
Step 3: Select Target Project
By default, data restores to the original project. You can override this:
- Same Project - Restore to source project
- Different Project - Select another connected project
Ensure the target project has appropriate schema and indexes for the restored data.
Step 4: Configure Options
| Option | Description | Default |
|---|---|---|
| Merge Mode | How to handle existing data | Overwrite |
| Include Auth | Restore Firebase Auth users | From backup |
| Dry Run | Preview without writing | Off |
Merge Modes
| Mode | Behavior |
|---|---|
| Overwrite | Replace existing documents |
| Skip Existing | Only restore missing documents |
| Merge | Merge fields into existing documents |
Step 5: Preview (Recommended)
Before restoring, preview what will change:
- Click Preview Changes
- Review the diff:
- Documents to be added
- Documents to be modified
- Documents to be deleted (if applicable)
Step 6: Execute Restore
- Review the restore summary
- Type the project name to confirm
- Click Start Restore
Monitoring Restore Progress
Real-Time Status
During restore, you'll see:
- Status: Current operation phase
- Progress: Percentage complete
- Documents: Count restored
- Errors: Any issues encountered
Restore Phases
- Initializing - Preparing restore job
- Downloading - Fetching backup from storage
- Decrypting - Decrypting backup data
- Decompressing - Decompressing data
- Validating - Verifying data integrity
- Restoring - Writing to Firestore
- Finalizing - Cleanup and verification
- Completed - Restore finished
Selective Restore
Restoring Specific Collections
- In the restore dialog, select Selective Restore
- Check the collections to restore
- Subcollections are included by default
Restoring Specific Documents
For granular restoration:
- Use Preview to browse backup contents
- Identify specific documents needed
- Use the API for document-level restore
# Restore specific documents via API
curl -X POST https://api.firebackup.io/api/v1/backups/restore \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"backupId": "backup-123",
"collections": ["users"],
"documentIds": ["user-456", "user-789"]
}'
Cross-Project Restore
Restore data to a different Firebase project:
Use Cases
- Environment promotion: Dev → Staging → Production
- Data migration: Old project → New project
- Testing: Production data → Test environment
- Disaster recovery: Primary → Secondary region
How to Cross-Project Restore
- Ensure target project is connected to FireBackup
- Select backup from source project
- In restore dialog, select target project
- Complete restore process
When restoring production data to test environments, consider removing sensitive fields using the selective restore feature.
Preview Backup Contents
Before restoring, you can explore backup contents:
Accessing Preview
- Navigate to the backup details
- Click Preview tab
- Browse collections and documents
Preview Features
- Collection browser - Navigate collection hierarchy
- Document viewer - View document fields and values
- Search - Find specific documents
- Export - Download preview data as JSON
Preview vs Actual Data
Compare backup contents with current data:
- Click Compare with Live
- View differences:
- Added documents (in backup, not in live)
- Modified documents (different values)
- Deleted documents (in live, not in backup)
Restore Verification
After restore completes:
Automatic Verification
FireBackup automatically verifies:
- Document count - Matches expected count
- Collection structure - All collections present
- Sample validation - Random document spot checks
Manual Verification
Recommended post-restore checks:
- Spot check critical documents - Verify key data
- Run application tests - Ensure functionality
- Check indexes - Verify Firestore indexes work
- Monitor for errors - Watch application logs
Restore History
View past restore operations:
- Navigate to Backups in the sidebar
- Click Restore History tab
- View all restore operations
| Field | Description |
|---|---|
| Date | When restore occurred |
| Backup | Source backup |
| Target | Destination project |
| Status | Success, Failed, or In Progress |
| Documents | Number of documents restored |
| Duration | Time to complete |
Handling Restore Failures
Common Failure Scenarios
Permission Denied
Error: IAM permission denied
Solution:
- Verify OAuth token is valid
- Check IAM roles on target project
- Re-authenticate if needed
Quota Exceeded
Error: Firestore write quota exceeded
Solution:
- Wait for quota reset
- Restore in smaller batches
- Request quota increase from Google
Network Timeout
Error: Connection timeout during restore
Solution:
- Check network connectivity
- Retry the restore
- For large restores, contact support
Partial Restore Recovery
If restore fails mid-operation:
- Note the error message and last processed document
- Check what was restored (may be partial)
- Fix the underlying issue
- Retry with Skip Existing mode to resume
Best Practices
Before Restore
- Always preview first - Understand what will change
- Backup current data - Create a backup before restoring
- Test in staging - Try restore in non-production first
- Notify stakeholders - Communicate planned restore
- Schedule maintenance - Restore during low-traffic periods
During Restore
- Monitor progress - Watch for errors
- Don't interrupt - Let restore complete
- Keep session active - Stay logged in
After Restore
- Verify data - Spot check critical documents
- Test application - Ensure functionality works
- Document the restore - Record what was restored and why
- Monitor application - Watch for issues
Restore API
For programmatic restore operations:
Start Restore
POST /api/v1/backups/restore
Content-Type: application/json
Authorization: Bearer YOUR_TOKEN
{
"backupId": "backup-123",
"targetProjectId": "my-project",
"options": {
"mergeMode": "overwrite",
"collections": ["users", "orders"],
"dryRun": false
}
}
Check Restore Status
GET /api/v1/backups/restore/{restoreJobId}
Authorization: Bearer YOUR_TOKEN
See API Reference for complete documentation.