/node-firestore-backup

Google Firebase Firestore backup tool

Primary LanguageJavaScript

firestore-backup

A Google Firebase Firestore backup tool.

codebeat badge Codacy Badge David badge Known Vulnerabilities

Installation

Install using npm.

npm install -g firestore-backup

or yarn

yarn global add firestore-backup

Alternatively download the source.

git clone https://github.com/steadyequipment/node-firestore-backup.git

Retrieving Google Cloud Account Credentials

  1. Visit the Firebase Console
  2. Select your project
  3. Navigate to Project Settings (at the time of writing the gear icon button at the top left of the page).
  4. Navigate to Service Accounts
  5. Click Generate New Private Key

This downloaded json file contains the proper credentials needed for firestore-backup to authenticate.

Usage

Backup:

  • -a, --accountCredentials <path> - Google Cloud account credentials JSON file.
  • -B, --backupPath <path>- Path to store the backup.

Example:

firestore-backup --accountCredentials path/to/credentials/file.json --backupPath /backups/myDatabase

Backup with pretty printing:

  • -P, --prettyPrint - JSON backups done with pretty-printing.

Example:

firestore-backup --accountCredentials path/to/credentials/file.json --backupPath /backups/myDatabase --prettyPrint

Relax:

That's it! ✨🌈

Contributions

Feel free to report bugs and make feature requests in the Issue Tracker, fork and create pull requests!