Lisa
Lisa

Reputation: 2989

How to export data from firebase by using 'curl'

According to the documentation, it is said:

You can go to your Firebase App Dashboard and export all of your data in JSON format. You can also export it via the REST API:

curl "https://<YOUR-FIREBASE-APP>.firebaseio.com/.json?print=pretty&auth=<YOUR-FIREBASE-APP-SECRET>"

However, when i use this in terminal, it all printed out inside the terminal and part of it did not show up because terminal only show limited lines.

Is there any way I can export data from firebase to a file?

Thanks!

Upvotes: 2

Views: 3217

Answers (1)

Roger Perez
Roger Perez

Reputation: 3139

Here is the solution that worked for me.

curl "https://<YOUR-FIREBASE-APP>.firebaseio.com/.json?print=pretty&auth=<YOUR-FIREBASE-APP-SECRET> > [json-file-name].json"

Example:

curl 'https://proj-name.firebaseio.com/repository/users.json?print=pretty' > data.json

Upvotes: 1

Related Questions