https://github.com/ernesto27/firestore-backup
https://github.com/ernesto27/firestore-backup
backup firebase firestore golang
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ernesto27/firestore-backup
- Owner: ernesto27
- License: apache-2.0
- Created: 2022-10-09T18:30:12.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-10-10T01:06:50.000Z (over 3 years ago)
- Last Synced: 2025-02-25T01:43:19.609Z (over 1 year ago)
- Topics: backup, firebase, firestore, golang
- Language: Go
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# FIRESTORE BACKUP
This is a simple tool to create backups from a firestore database.
## Installation
You need to have installed golang and configured $GOPATH environment variable.
After that run this command
```bash
go install github.com/ernesto27/firestore-backup
```
## Usage
```bash
firestore-backup [firebase-credentials.json] [collections..]
```
First parameter "firebase-credentials.json" is the config firebase file that you can download from your firebase console.
```
Project settings -> Service accounts -> Firebase admin SDK
```
"collections.." is the name of the collections that you want to backup.
## Example
```bash
firestore-backup firebase-credentials.json users posts
```
This will create two files "users.json" and "posts.json" with the data of the collections.
Example users.json
```json
{
"fNttol9VYulnwkFSir6p": {
"name": "name1",
"uid": "oU4IC2RLSEQvGITjZLcPplMmjZs1"
},
"oZs16BA72KgmFdVoGdYh": {
"name": "name2",
"uid": "BJT295K2wpQkewA8kvMQeJrEhdk1"
}
}
```