From 29b946671b3895d8174b8af108b9607bc5862175 Mon Sep 17 00:00:00 2001 From: Austin Chen Date: Tue, 25 Jan 2022 15:27:44 -0600 Subject: [PATCH] Expand backup documentation --- functions/src/backup-db.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/functions/src/backup-db.ts b/functions/src/backup-db.ts index 45a06b83..cc5c531d 100644 --- a/functions/src/backup-db.ts +++ b/functions/src/backup-db.ts @@ -1,6 +1,20 @@ // This code is copied from https://firebase.google.com/docs/firestore/solutions/schedule-export -// To deploy after any changes: `yarn deploy` -// To import the data into dev Firestore: https://firebase.google.com/docs/firestore/manage-data/move-data +// +// To deploy after any changes: +// `yarn deploy` +// +// To manually run a backup: Click "Run Now" on the backupDb script +// https://console.cloud.google.com/cloudscheduler?project=mantic-markets +// +// Backups are here: +// https://console.cloud.google.com/storage/browser/manifold-firestore-backup +// +// To import the data into dev Firestore (from https://firebase.google.com/docs/firestore/manage-data/move-data): +// 0. Open up a cloud shell from manticmarkets@gmail.com: https://console.cloud.google.com/home/dashboard?cloudshell=true +// 1. `gcloud config set project dev-mantic-markets` +// 2. Get the backup timestamp e.g. `2022-01-25T21:19:20_6605` +// 3. `gcloud firestore import gs://manifold-firestore-backup/2022-01-25T21:19:20_6605 --async` +// 4. (Optional) `gcloud firestore operations list` to check progress import * as functions from 'firebase-functions' import * as firestore from '@google-cloud/firestore'