[SERVER-40424] Extract data from .wt file Created: 01/Apr/19 Updated: 03/Apr/19 Resolved: 03/Apr/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | anne-laure trabon | Assignee: | Danny Hatcher (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Hi I've a corrupted MongoDb with WiredTiger Engine database. i urgently need data from a single collection file. is there a way to extract the data of a single wired tiger collection file ?
Thanks for your help |
| Comments |
| Comment by Danny Hatcher (Inactive) [ 03/Apr/19 ] |
|
Hello, Unfortunately, there is nothing else that we can do. Going forward, it is our strong recommendation to:
Thank you, Danny |
| Comment by anne-laure trabon [ 03/Apr/19 ] |
|
Hello, If we don't have all the wiredtiger files of the database but only one that represents the data that we really want to retrieve, do you think it still possible to do the operations we talked about ? Thanks, Anne-Laure |
| Comment by anne-laure trabon [ 02/Apr/19 ] |
|
Yes, will do. I'll get back to you as soon as we try this. Anne-Laure |
| Comment by Danny Hatcher (Inactive) [ 02/Apr/19 ] |
|
Yes, please try to do so. If the repair fails to resolve the issue, please upload the mongod.log from the attempt as well as the WiredTiger.wt and WiredTiger.turtle files. Thanks, Danny |
| Comment by anne-laure trabon [ 02/Apr/19 ] |
|
Ok, so we could for example, create a mongoDB instance on a local machine running on the 4.0 version to execute the repair. That way, we could have the data locally and we'd have the possibility to extract it from there to then be able to insert it again in another production DB. Would that make sense ? Thanks again for your help, much appreciated Anne-Laure |
| Comment by Danny Hatcher (Inactive) [ 02/Apr/19 ] |
|
Hello, If you repair using the 4.0 binaries and it is successful, you would go back to using your original version. We made significant improvements to the --repair functionality that only exist in 4.0 which is why I suggested running it with that version. Unfortunately, we have no way to extract the data other than by starting up a viable MongoDB instance. The --repair solution or providing the files may enable us to do so. Thanks, Danny |
| Comment by anne-laure trabon [ 02/Apr/19 ] |
|
We can't update our server version to MongoDB 4.0 because our programs using our DB aren't compatible with it (our version is 3.4). I also, wanted to add a piece of information, we're not trying to import the data in a new instance of mongo, we're only focusing on retrieving the data in some kind of format that we can use afterwards. Would it be possible to extract the data with, for example, a decompressor or something ? Thanks, Anne-Laure |
| Comment by Danny Hatcher (Inactive) [ 02/Apr/19 ] |
|
Hello, Have you tried running MongoDB 4.0.8 binaries using mongod --repair against the data? Please try that first. If the repair doesn't work, please upload the logs that result as well as the WiredTiger.wt and WiredTiger.turtle files from your $dbpath. Thank you, Danny |
| Comment by anne-laure trabon [ 02/Apr/19 ] |
|
Hi, thanks for your reply. We only keep logs for 5 days and the issue happened more than a week ago. But what I can tell you is that the hard disk switched on read only mode and then the machine did a restart. I was also wondering on what conditions will it be possible to retrieve the data programmatically from the file ? Thank you !
Anne-Laure |
| Comment by Danny Hatcher (Inactive) [ 01/Apr/19 ] |
|
Hello, There may be a way to recover the data but it will depend on how the corruption occurred. Can you go into detail about how you first noticed the database was corrupted? Please provide the mongod log file from the node covering the timeframe from before the corruption until now. Thank you, Danny |
| Comment by anne-laure trabon [ 01/Apr/19 ] |
|
I forgot to mention that we'd like to extract the data programmatically if possible. |