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/
- Create a Google Cloud Storage bucket in the same project as the Firestore Database.
- Create a service account with the "Cloud Datastore Import Export Admin" role.
- Store the JSON key somewhere it can be retrieved later.
- Grab a release from the releases page
- Extract the release
- Run
FirestoreRestore
- Clone this repo
- Run
make
- Run
./FirestoreRestore
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.
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.
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