Importing to Atlas from .wt files

I have a zipped directory full of .wt files that we would like to import into Atlas. They were exported from either mLab or Atlas on 23 December 2020. I tried running
mongod --dbpath "my-files-path" --repair
in an attemtp to get a db running so we could run mongoexport, and got this log. Running “show dbs” and “show databases” in a mongo client running against the local instance that should have this data, and seeing 0 GB present.
The full log is available via DM but includes a lot of “Verify succeeded. Not salvaging.”

Unfortunately this backed up data is all on a windows machine and since it is healthcare data we are very reluctant to move it elsewhere using any transport options we have thought of yet.

{"t":{"$date":"2021-01-12T17:03:47.956-08:00"},"s":"I",  "c":"STORAGE",  "id":21028,   "ctx":"initandlisten","msg":"Collection validation","attr":{"results":{"ns":"REDACTED.checkins","nInvalidDocuments":0,"nrecords":576055,"nIndexes":3,"keysPerIndex":{"_id_":576055,"encrypted_user_id_1":576055,"date_1_encrypted_user_id_1":576055},"indexDetails":{"_id_":{"valid":true},"encrypted_user_id_1":{"valid":true},"date_1_encrypted_user_id_1":{"valid":true}}}}}
{"t":{"$date":"2021-01-12T17:03:47.956-08:00"},"s":"I",  "c":"STORAGE",  "id":21027,   "ctx":"initandlisten","msg":"Repairing collection","attr":{"namespace":"REDACTED.patterns"}}
{"t":{"$date":"2021-01-12T17:03:47.967-08:00"},"s":"I",  "c":"STORAGE",  "id":22327,   "ctx":"initandlisten","msg":"Verify succeeded. Not salvaging.","attr":{"uri":"table:collection-39--6970771647752306069"}}


{"t":{"$date":"2021-01-12T17:03:48.044-08:00"},"s":"I",  "c":"STORAGE",  "id":21028,   "ctx":"initandlisten","msg":"Collection validation","attr":{"results":{"ns":"admin.system.version","nInvalidDocuments":0,"nrecords":1,"nIndexes":1,"keysPerIndex":{"_id_":1},"indexDetails":{"_id_":{"valid":true}}}}}

Hi @CWW

Welcome to MongoDB community.

Have you tried to just start this mongod (without --repair) and use a mongodump and mongorestore to atlas?

If the files you have are not corrupted starting the relevant version instance should not be a problem.

Best
Pavel

1 Like

Yes, I tried that. mongod declined to start. I didn’t save the error but I can replicate it if it might be useful.

Unfortunately we are not sure what version of mongod the files were exported from, but I believe that they were extracted from mLab as part of the mLab shutdown.

I don’t know how to see the version of mongod that the .wt files were exported from in the files themselves- I’ve been trying to read them with bsondump but I don’t understand them. Do you think there’s a way to tell what version of mongod should be used from the files themselves?

@CWW,

Seeing the error might help, as incompatible binaries might error our starting a different version dbPath