Skip to content

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

License

Notifications You must be signed in to change notification settings

ChristianAlexander/FirestoreRestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published