Firestore Backups the easy way with Cloud Workflows

Márton Kodok
Google Cloud - Community
7 min readFeb 15, 2021

--

Backup every night your Firestore collections to secure Cloud Storage the easy way with Cloud Workflows, you don’t need to be a developer to setup the steps.

Firestore Backups the easy way with Cloud Workflows
Firestore Backups the easy way with Cloud Workflows

Database Backups! We know how important they are, a wrong click and someone could delete your collection or the entire database. In the case of a Disaster Recovery Plan is activated you need to have your backups to resume business operation.

Let’s make sure your Firestore/Datastore collections backup every night to secure storage.

Introduction

There are various ways to trigger Cloud Firestore backups, either by using Datastore Import/Export UI, the firebase CLI tool, or using the exportDocuments API but they are not automated and need developer assistance.

In this article, we are going to orchestrate the automated backups via Cloud Workflows, we will store the exports in Cloud Storage, and we will trigger the workflow with Cloud Scheduler. These steps are fully managed and serverless, easy to setup by non-developers as well. Your project must have billing enabled.

Steps

  1. Create the Cloud Storage bucket
  2. Create the Cloud Workflow definition to execute Firestore export API call

--

--

Márton Kodok
Google Cloud - Community

Speaker at conferences, a Google Developer Expert top user on Stackoverflow, software architect at REEA.net, co-founder IT Mures, life-long learner, mentor