Convert google firestore/datastore LevelDB exports to JSON data.
Clone the repository.
$ git clone git@github.com:labbots/firestore-export-json.git
$ cd firestore-export-json
Create a new virtual environment within the project directory.
$ python -m venv venv
Activate the virtual environment in the project.
$ source ./venv/bin/activate
Install framework dependencies.
$ pip install -e .
Clone the repository.
$ git clone git@github.com:labbots/firestore-export-json.git
$ cd firestore-export-json
Run the make command
$ make install
-P
/--processes
flags e.g. ./fs_to_json.py source/ dest/ -P 1
-C
/--clean-dest
flag e.g. ./fs_to_json.py source/ dest/ -C
-c
/--no-check-crc
flag.
The penalty for not running any crc32c checks is that you might have corrupt or missing data in the json output.fs_to_json.py
can be used to convert the firestore/datastore export files to JSON data.
$ python fs_to_json.py path_to_source_dir path_to_destination
output-0
exists as source directory usually this would be kinds_*
directory.json
folder in source directory.e.g.
# this will look for all files in exports/all_namespaces/kind_collection-id that start with `output-` and put the resulting json files in out/collection-id
python fs_to_json.py exports/all_namespaces/kind_collection-id out/collection-id
The project exposes console script using setuptools to provide fs_to_json
CLI command which can be used to convert exports to JSON.
$ fs_to_json path_to_source_dir path_to_destination