Firebase restore from backup into (default)

I'm in the process of testing out the Firebase backup features that are currently in Alpha.

The backup process seems to work well but I'm not totally sure what the intended recovery procedure is.

At the moment the restore operation must restore into a new Firestore instance. What's the process of migrating the restored data to my users?

There seem to be two options. Either point my users to the new database or copy the new database to my `(default)` instance.

Pointing my users to the new instance has two major drawbacks

  • I have to push a new version of my app to users and wait for them to update
  • I no longer get to take advantage of the free limits that only apply to the `(default)` instance

Copying the data over to my `(default)` instance doesn't seem to have a clear path.

  • Is there a way to directly copy from one database instance to another?
  • Is the best approach to export the new database's contents into a bucket, wipe `(default)` and import the restored data?

I'm not clear on what the expected recovery process is for this new(er) backup feature.

Thanks

Solved Solved
0 4 783
1 ACCEPTED SOLUTION

The Firebase backup feature is currently in Alpha, so the recovery process is not yet finalized. However, the two options you mentioned are the most likely approaches:

  1. Point your users to the new database instance. This would require you to push a new version of your app that uses the new database connection string. It would also mean that your users would no longer be able to take advantage of the free limits for the default database instance.
  2. Copy the data from the new database instance to the default database instance. This is more complex, but it would allow your users to continue using the default database instance and taking advantage of the free limits.

To copy data from one database instance to another, you can use the following steps:

  1. Export the data from the new database instance to a bucket.
  2. Wipe the default database instance.
  3. Import the data from the bucket into the default database instance.

You can use the Firebase CLI to export and import data. For more information, see the following documentation:

Expected recovery process

The expected recovery process for the Firebase backup feature is still under development. However, it is likely that the two options you mentioned will be the most common approaches.

Recommendation

My recommendation is to use the first approach (point your users to the new database instance) while the Firebase backup feature is still in Alpha. This is the simpler approach, and it will allow you to start testing the backup and recovery process with your users.

Once the Firebase backup feature is out of Alpha, you can evaluate the two options more carefully and choose the approach that best meets your needs.

Additional considerations

  • If you are using Firebase Authentication, you will need to make sure that your users are able to authenticate to the new database instance.
  • If you are using any third-party Firebase services, you will need to make sure that they are compatible with the new database instance.
  • You should test the recovery process thoroughly before deploying it to production.

View solution in original post

4 REPLIES 4

The Firebase backup feature is currently in Alpha, so the recovery process is not yet finalized. However, the two options you mentioned are the most likely approaches:

  1. Point your users to the new database instance. This would require you to push a new version of your app that uses the new database connection string. It would also mean that your users would no longer be able to take advantage of the free limits for the default database instance.
  2. Copy the data from the new database instance to the default database instance. This is more complex, but it would allow your users to continue using the default database instance and taking advantage of the free limits.

To copy data from one database instance to another, you can use the following steps:

  1. Export the data from the new database instance to a bucket.
  2. Wipe the default database instance.
  3. Import the data from the bucket into the default database instance.

You can use the Firebase CLI to export and import data. For more information, see the following documentation:

Expected recovery process

The expected recovery process for the Firebase backup feature is still under development. However, it is likely that the two options you mentioned will be the most common approaches.

Recommendation

My recommendation is to use the first approach (point your users to the new database instance) while the Firebase backup feature is still in Alpha. This is the simpler approach, and it will allow you to start testing the backup and recovery process with your users.

Once the Firebase backup feature is out of Alpha, you can evaluate the two options more carefully and choose the approach that best meets your needs.

Additional considerations

  • If you are using Firebase Authentication, you will need to make sure that your users are able to authenticate to the new database instance.
  • If you are using any third-party Firebase services, you will need to make sure that they are compatible with the new database instance.
  • You should test the recovery process thoroughly before deploying it to production.

Thank you for the clarification. How would we as developers find out when a certain gcloud feature is out of Alpha? Is there a blog post or email list that we can subscribe to so that we can get notified?

The Firestore release notes page documents production updates to Firestore. You can periodically check this page for announcements about new or updated features, bug fixes, known issues, and deprecated functionality. The page also includes information on when features move from Alpha or Beta stages to General Availability (GA).

All good advice! Thanks for the clarification and quick response. It's good to know I didn't overlook a better approach.

I appreciate that the backup feature is currently in alpha and still being ironed out. Hopefully, as the feature is finalized we'd be able to change the default database for our Firebase project and have it take on all of the free tier cost benefits.

If not, a direct operation that allowed us to copy from one database to another would be beneficial. That way we don't have to bounce through the whole export, import process with all of the associated extra costs.