Export and Back Up Firestore Data to JSON, CSV or Excel
Sooner or later someone asks for "the data in a spreadsheet". Or you are about to run a risky bulk change and want a safety copy first. Both jobs come down to getting your Firestore data out in a usable form.
This guide shows how to export, back up, import and restore Firestore collections from an Android phone using FireAdmin, a free app on Google Play. FireAdmin is an independent app by Smartrix Labs and is not affiliated with Google or Firebase.
Which format should you pick?
| Format | Best for |
|---|---|
| JSON | Keeping the exact structure, including nested maps and arrays. Best for backups and for re-importing. |
| CSV | Flat tables you open in a spreadsheet or load into another tool. |
| Excel | Sharing with people who work in spreadsheets and want a ready .xlsx file. |
Firestore documents can be nested. Flat formats like CSV and Excel have to squeeze that structure into rows and columns, so deeply nested data may not look as tidy. When you need a faithful copy, choose JSON.
Step-by-step: export a collection
- Install FireAdmin and sign in with a Google account that can access the project.
- Select the project, then open the Export and Import area.
- Choose the collection you want.
- Pick JSON, CSV or Excel.
- Run the export and save or share the file from your phone.
You can also export only part of your data. Run a query first, for example orders from the last month, and work from that result rather than the whole collection. Smaller exports are faster and cheaper, because Firestore bills one read for each document it returns.
Back up before you change anything
FireAdmin includes a collection backup tool that saves an entire collection to JSON in one tap. It also supports scheduled backups (daily, weekly or monthly) and keeps a backup history showing the size and number of documents, with restore available from that history.
A sensible routine:
- Before a bulk edit or delete, back up the collection.
- Check the backup history shows a plausible document count.
- Make the change.
- If something goes wrong, restore from the backup.
Be careful with the word "backup". A file saved on your phone is only as safe as your phone. For anything important, also move a copy somewhere you control, and look at Google's own managed backup options for Firestore in your project if you need full-database disaster recovery.
Import data from a file
You can import JSON files back into Firestore, with validation before the data is written. This is useful for restoring a backup, seeding a staging project, or loading a small set of records.
- Test the import on a staging project first.
- Look at the validation result before you confirm.
- Check document IDs. If an imported document uses the same ID as an existing one, you may overwrite data you wanted to keep.
- After importing, open a few documents and compare them to the source.
Batch updates and deletes
For cleaning up lots of documents, select several with a long press and delete them in one go. Combine this with a query: filter down to the exact documents you want gone, review the list, then delete. Always export the same query result first, so you have a record of what was removed.
To check what changed on a single record, use Data Diff to compare two documents side by side.
A quick pre-flight checklist
- Right project selected?
- Right collection spelled correctly?
- Backup taken and the document count looks right?
- Query limited to only what you mean to change?
- Staging tested first, if you have one?
It takes a minute and can save a day of recovery. If you do not have the app yet, get it from Google Play.
Real-world uses for an export
People export Firestore data for different reasons, and the reason decides the format and the care you need.
- Reporting. A manager wants last month's orders in a spreadsheet. Run a query for that month, export to Excel or CSV, and share the file.
- Debugging. Export a few problem documents as JSON and compare them with healthy ones.
- Moving between projects. Export from production as JSON and import a small sample into staging so you can test with realistic data. Remove personal information from any copy that leaves production.
- Handover. Give a client or teammate a snapshot of their data at a point in time.
Exports can contain personal data such as names and emails. Treat the files like the database itself: do not leave them in shared folders or send them over unprotected channels, and delete copies you no longer need.
FAQ
Which export formats does FireAdmin support?
JSON, CSV and Excel.
Can I restore a backup?
Yes. FireAdmin keeps a backup history and supports restore, and it can also import JSON files back into Firestore.
Can I schedule automatic backups?
Yes. You can schedule backups daily, weekly or monthly.
Does exporting cost money?
Firestore bills a read for each document read, so large exports use reads. Check the Firebase pricing page for current free allowances and rates before exporting very large collections.