My mongodb can't lanuch now, when I want start mongo got error ***aborting after invariant() failure
Now I want to restore collection-0-****.wt file to a new db, is this possible?
wt files from your Atlas Backup restore folder into your local /data/db path . Restart your Ubuntu or MongoDB server. Start your Mongo shell and you should have those restored files there.
Run the MongoDB system command ps -ef | grep mongod to find the temporary recovery MongoDB instance location. Run the MongoDB mongodump command to create a dump file of any specific database or collection. Run the mongorestore command to restore the dump file into any MongoDB instance.
wt files contain the data of the MongoDB collections and indexes that you observe as a client connected to a MongoDB instance. Once you've identified the WT ident value for the collection or index you want to inspect you can use that in the URI argument to the wt dump command.
How do you open WT files? You need a suitable software like WildTangent to open a WT file. Without proper software you will receive a Windows message "How do you want to open this file?" or "Windows cannot open this file" or a similar Mac/iPhone/Android alert.
As at MongoDB 3.2, only full backups of WiredTiger data directories can be copied into a new instance. WiredTiger collection or index files aren't self-contained; they rely on other metadata in the WiredTiger.*
catalog files. The invariant/assertion you are getting on startup is expected if data files are incomplete or inconsistent.
If you want to backup and restore a single collection, you should use mongodump
and mongorestore
, eg:
mongodump --db test --collection northwind --host host1
mongorestore --db test dump/test/northwind.bson --host host2
For supported full backup procedures, see: MongoDB Backup Methods.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With