Skip to content

ChristianAlexander/FirestoreRestore

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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