We have recovered a MongoDB database from filesystem, but the WiredTiger.wt
file has changed since then (i.e. the collection has been dropped).
So is it possible to read data (documents) from some .wt
files without having the corresponding WiredTiger.wt
?
Or create a WiredTiger.wt
file with our own .wt
files?
I have also asked this question on StackExchange:
http://dba.stackexchange.com/questions/183267/recover-mongodb-data-without-wiredtiger-wt-file
Hi Mohammad
We have recovered a MongoDB database from filesystem, but the WiredTiger.wt file has changed since then (i.e. the collection has been dropped).
Could you elaborate on what you did? Did you perform the recovery by overwriting some collection-*.wt
files inside your dbpath
?
If that is the case, then your database is in an unsupported state, and it’s likely that you lost your data. If you want to restore the database, you would need to restore the dbpath
as a whole and not as individual files. Please see MongoDB Backup Methods for instructions and information on supported backup and restore methods.
The WiredTiger.wt file is a crucial metadata file that keeps track of the state of the whole database and all the *.wt
files. Hence, the content of this file is deployment specific, and not transferrable to other deployments. It is not possible to recreate the content of this file.
If you have a known good backup of the whole dbpath
, you may be able to restore to a valid state of the database, as long as you restore the dbpath
as a whole.
Best regards,
Kevin