Python script to delve into MongoDB's WiredTiger data files
pip install pymongo
pip install wiredtiger
pip install blessings
Please note that proper tooling is required to install the WiredTiger Python module. Please refer to the WiredTiger documentation for instructions on how to successfully compile WiredTiger.
usage: PyWT.py [-h] [--dbpath DBPATH] [--list] [--raw] [--pretty]
[--table TABLE] [--export EXPORT] [--export-all]
optional arguments:
-h, --help show this help message and exit
--dbpath DBPATH dbpath (defaults to the current directory)
--list print MongoDB catalog content
--raw print raw data
--pretty pretty print documents
--table TABLE WT table to print
--export EXPORT MongoDB namespace to export
--export-all Export all MongoDB namespaces
List MongoDB namespace <-> WiredTiger tables:
PyWT.py --dbpath /data/db --list
Pretty print the contents of a specific WiredTiger table:
PyWT.py --table _mdb_catalog --pretty
Restore a specific MongoDB namespace to a running MongoDB instance:
PyWT.py --export test.collection | mongoimport -d test -c collection