angga nugraha
angga nugraha

Reputation: 19

how to backup my firebase datase to another server, in cloud server hosting or VPS server

I have an application on firebase, but I must have server backup on another server, in cloud hosting or VPS, Please help me

Upvotes: 1

Views: 216

Answers (1)

robsiemb
robsiemb

Reputation: 6374

Both Firebase Realtime Database and Firestore offer backup capability to a GCS bucket.

Firebase Realtime Database:

  • Use the "Backups" tab on the console and use the wizard to configure the backup. There's more about how to restore and how files are named here. There is no additional cost for the backup operation, but you are obviously charged for the storage of the backups in GCS.

For Firestore:

  • You can use the gcloud firestore export gs://[BUCKET_NAME] command to export to a GCS bucket, either the entire database or just one collection. Full documentation about restores, partial exports, etc, is here. Note you are charged for document reads to do the backup in addition to the GCS storage costs.
  • There does not appear to be a built-in way to automate this but the Admin SDK includes a FirestoreAdminClient.exportDocuments (that link is for Node) call you could presumably use to call from a scheduled cloud function to do the work.

You must be on the Blaze (pay as you go) plan for both databases.

Upvotes: 1

Related Questions