An experimental utility to export and import Google Cloud Firestore databases.
Switch branches/tags
Nothing to show
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor chore: Initial vendor Jul 19, 2018
Dockerfile chore: Add Dockerfile Aug 22, 2018
Gopkg.lock chore: Initial vendor Jul 19, 2018
Gopkg.toml chore: Initial vendor Jul 19, 2018
LICENSE chore: Add license Jul 19, 2018
README.md docs: Add Docker automated build tag to README Aug 22, 2018
job-metadata.go Initial implementation Jul 19, 2018
main.go Initial implementation Jul 19, 2018
makefile chore: Disable CGO in makefile Aug 22, 2018

README.md

FirestoreRestore

Docker Automated build

An experimental utility to export and import Google Cloud Firestore databases.

See the blog post at https://christianalexander.com/2018/07/18/firestore-backup-restore/

Requirements

  1. Create a Google Cloud Storage bucket in the same project as the Firestore Database.
  2. Create a service account with the "Cloud Datastore Import Export Admin" role.
  3. Store the JSON key somewhere it can be retrieved later.

Building and Running

From Release

  1. Grab a release from the releases page
  2. Extract the release
  3. Run FirestoreRestore

From Source

  1. Clone this repo
  2. Run make
  3. Run ./FirestoreRestore

Usage

All commands must be run with the GOOGLE_APPLICATION_CREDENTIALS environment variable set to the path where the JSON key is located. See Google documentation for more details.

Backup

FirestoreRestore -backup -wait -p <GOOGLE PROJECT ID> -b <BUCKET NAME> -n <BACKUP NAME>

If -n is not specified, the backup will be named after the current time.

Restore

FirestoreRestore -wait -p <GOOGLE PROJECT ID> -b <BUCKET NAME> -n <BACKUP NAME>

The -n value should be a path relative to the root of the bucket, such as backups/abcd