Trying to salvage data

Skip to first unread message

Elma Gacic

Oct 28, 2020, 8:12:16 PM10/28/20
to wiredtiger-users
We had a major problem on our production server. Unfortunately all our mongo data (db data directory) was deleted. Mongo was run in docker  container and new instance of db data directory was created. We managed to recover the lost mongod directory  using testdisk and replace a newly created mongod (which is db data ) dir with the recovered one. I can start mongod , but it doesn't see any of the recovered data.  I have about 680M of data in /data/db dir , but nothing shows in db.

> show dbs
am  0.000GB
None of the collection-xxxx.wt files was used . New ones were being created.

I tried to use wt tool in container to salvage the data directly from  collection-x-xxxxx.wt files, but it didn't work:

 ./wt -v -h /data/db -C "extensions=[./ext/compressors/snappy/.libs/libwi]" -R salvage collection-0-2860746021073474554.wt

/wiredtiger/wiredtiger-2.7.0/.libs/wt: error while loading shared libraries: cannot open shared
object file: No such file or directory

I ran mongo outside container putting recovered data in its dbpath and that didn't work either (attached mongo.log)

When I tried to salvage the data (outside container) I got this:
 ./wt -v -h /root/appraisermetrics/mongodb -C "extensions=[./ext/compressors/snappy/.libs/]" -R salvage collection-0-2860746021073474554.wt
[1603929726:17081][311698:0x7f151f843b80], file:WiredTiger.wt, connection: unable to read root page from file:WiredTiger
.wt: WT_ERROR: non-specific WiredTiger error
[1603929726:17299][311698:0x7f151f843b80], file:WiredTiger.wt, connection: WiredTiger has failed to open its metadata
[1603929726:17391][311698:0x7f151f843b80], file:WiredTiger.wt, connection: This may be due to the database files being e
ncrypted, being from an older version or due to corruption on disk
[1603929726:17462][311698:0x7f151f843b80], file:WiredTiger.wt, connection: You should confirm that you have opened the d
atabase with the correct options including all encryption and compression options
wt: WT_ERROR: non-specific WiredTiger error

Is there any way I can salvage this data?

Any help would be highly appreciated.


Oct 29, 2020, 5:36:59 PM10/29/20
to wiredtiger-users

Thanks for reaching out, and I'm sorry to hear that you have had a problem with your data. Since you are running with MongoDB, the better place to ask for help is the MongoDB community forums (

Generally it's not advisable to attempt direct manipulation of a database generated with MongoDB using the wt command line utility.

- Alex
Reply all
Reply to author
0 new messages