Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How can we verify the firestore scheduled backup ? and see the backup size/ files

i have a backup that i managed to created 
and it shows:
```
database: projects/project/databases/(default)
databaseUid: id
expireTime: '2023-11-15T19:30:58.935967Z'
name: projects/project/locations/nam5/backups/id
snapshotTime: '2023-11-13T19:30:58.898236Z'
state: READY
```

so how can i check now if the backup is ok? what is the size of the backup ? 
where is saved in the bucket?

0 8 2,361
8 REPLIES 8

Update 5/1/2024:

Firestore's managed backup and restore service, does not use Google Cloud Storage (GCS) buckets in the same way that manual exports and imports do.

To clarify:

  1. Managed Backups: Firestore managed backups automatically backs up your data at scheduled intervals. These backups are handled by Google internally and do not require user interaction with Google Cloud Storage. They're designed for ease of use and reliability, providing automatic and periodic snapshots of your data.

  2. Manual Exports/Imports: This is the method where Firestore data is exported to or imported from Google Cloud Storage. This process involves using the gcloud command-line tool or Firebase Console to trigger exports and imports. This is useful for ad hoc backups, data migrations, or when you need to have physical files in GCS that you can manipulate or move to another environment.

  3. Checking Managed Backup Details: For managed backups, you can view the backup configurations and their statuses through the Google Cloud Console, particularly within the Firestore section under "Backups." Here, you can manage the settings, see the status of each backup, and restore from these backups as needed.

  4. Restoring Data: For managed backups, restoration can also be initiated from the Google Cloud Console, where you can select from the available backups and restore them to the original or to a new Firestore instance.

To verify the integrity and size of your scheduled Firestore backup, follow these steps:

  1. Check the Backup Status:

    • Go to the Firebase console and navigate to your project.
    • Access the "Backups" tab. Here, locate your backup and check if its status is "READY", indicating a successful completion.
  2. View Backup Details:

    • Click on the backup entry to view more details. The "Snapshot Time" shows when the data was captured, and the "Expire Time" indicates when this backup will be deleted automatically.
  3. Access Backup Files in Cloud Storage:

    • Firestore backups are stored in a Cloud Storage bucket. The bucket's name and location might have been set during the backup configuration. If it's not visible in the backup details, you may need to check your Firestore backup settings or use the Google Cloud Console or SDK to find the correct bucket.
  4. Verify Backup Size:

    • In the Cloud Storage console, locate the bucket containing your backup files. Here, you can check the total size of these files, giving you an idea of the data volume in the backup.
  5. Validate Backup Integrity:

    • To ensure the backup's integrity, consider restoring it to a test environment or importing it into a different Firestore database. This step is crucial to verify that the data is intact and the backup is reliable for future data recovery.
  6. Additional Considerations:

    • Ensure you have the necessary permissions to access Firestore backups and Cloud Storage.
    • Regularly monitor and test backups to confirm ongoing data integrity.
    • Be mindful of any costs associated with Cloud Storage and data restoration in Firestore.

Hi, I don't see a "Backups" tab in the Firebase console.

Yes, I have looked everywhere too, there is no "Backups" tab...

@ms4446; So, I've setup Firebase Backup for a "(default)" database. By using "gcloud firestore backups schedules list", I can get the scheduled backups. And by using "gcloud firestore backups list", I can get each backup.
Each backup does list the snapshotTime, and the "state".

However, how do I:
1) Validate that the backup actually works (non-corrupted)
2) Download backup (to extract a specific document or similar, if possible, without restoring full backup to another DB-destination)
3) Check the size of each snapshot (backup)
4) Check the total amount of space used for snapshots (backups)

I cannot find those topics in the official docs: https://firebase.google.com/docs/firestore/backups.

Firebase’s managed backup service offers automated backups, but it does have some limitations. 

First, while backups marked state: READY indicate successful completion, they do not offer explicit validation of data integrity at the document level. To ensure backups are functioning correctly, users should periodically restore backups to a staging environment. Though Firestore backups are reliable, users managing critical data may benefit from using manual exports for additional redundancy and validation.

Second, Firebase’s managed backups do not support partial access or direct download of specific documents. The data is stored in a proprietary format, and there is no way to extract individual documents without restoring the full backup. As a workaround, users can restore a backup to a temporary Firestore instance and then export specific documents using the Firestore export functionality.

Third, there is no direct way to check the size of individual backup snapshots. Firebase does not offer tools for snapshot size reporting. However, users can monitor overall backup storage usage via Google Cloud Billing reports, which provide insights into the total storage consumed by all backups. For more detailed size information, reaching out to Firebase support may be necessary.

Finally, while backups are stored using Google’s internal infrastructure, the total space consumed by backups is visible only through billing reports. This makes it difficult to manage backup storage at a granular level, unlike manual exports, which are stored in Google Cloud Storage and offer greater visibility.

Firebase managed backups are designed for full database restoration in the event of a disaster, not for fine-grained backup control. If users require more detailed access, partial downloads, or snapshot sizes, they should consider manual exports or third-party backup solutions. Submitting feature requests to Firebase for these functionalities may also help improve the service over time.

Thank you for the reply.

for now , backups seem to be available in the firebase console only on realtime databases, not firestore databases

Yes, currently Firestore doesn't offer the same convenient in-console backup management for backups as Firebase Realtime Database. Firestore backups are indeed managed and stored in GCS as I previously described.

While it might be a bit less streamlined than the experience for Realtime Database, the tools and methods outlined earlier still give you full control and visibility into your Firestore backups.