Skip to content

backups

Amy J. Ko edited this page Oct 14, 2023 · 1 revision

We're currently using a public (alpha) preview of Firestore backups on the production database. It requires the Google Cloud CLI, so install that if you haven't yet.

Amy is currently the only person with permissions to manage backups, but we will grow this team eventually. See the Firebase backups link page for more details on what permissions are required to manage backups.

We've configured them as daily backups, retained for one week, with the following command. It sets the selected project to the production Wordplay project, logins in if necessary, and then creates the database backup schedule.

gcloud config set project wordplay-prod gcloud auth login gcloud alpha firestore backups schedules create --database='(default)' --recurrence=daily --retention=7d

To do a restore, first list the available backups:

gcloud alpha firestore backups list --format="table(name, database, state)"

Then restore based on the information in the listing:

gcloud alpha firestore databases restore source-backup=projects/wordplay-prod/locations/us-central1/backups/BACKUP_ID --destination-database='(default)'

The restore via this method is comprehensive; we don't yet do any point-in-time recovery of data.

Clone this wiki locally