snippetMinor
How to restore from .wt files?
Viewed 0 times
fromfilesrestorehow
Problem
Environment
Windows Professional 10
MongoDB 3.6.4 2008R2Plus SSL (64 bit)
MongoDB 4.0.2 2008R2Plus SSL (64 bit)
I have been developing locally, and turned on computer today to blue screen of death.
I had no option but to reset Windows 10 and keep personal files.
I therefore have this directory:
which contains two directories,
Below is contents of directory
Below is contents of directory
I have downloaded and installed:
MongoDB 4.0.2 2008R2Plus SSL (64 bit)
and I accepted the default installation directories:
Question
How can I restore the databases and collections from the contents of my original mongoDB
Note - I am on the same computer, after a Windows 10 reset, and new install of MongoDB.
Related Questions
There are similar questions below, but they don't seem to provide an authoritative and accepted answer:
How to restore .wt backup file to local MongoDB?
How to copy wt files from another mongo instance?
https://stackoverflow.com/q/37557319
https://stackoverflow.com/q/32551549
Windows Professional 10
MongoDB 3.6.4 2008R2Plus SSL (64 bit)
(before computer crash)MongoDB 4.0.2 2008R2Plus SSL (64 bit)
(after computer crash) I have been developing locally, and turned on computer today to blue screen of death.
I had no option but to reset Windows 10 and keep personal files.
I therefore have this directory:
C: > data which contains two directories,
db and log. Below is contents of directory
db:Below is contents of directory
log:I have downloaded and installed:
MongoDB 4.0.2 2008R2Plus SSL (64 bit)
and I accepted the default installation directories:
Question
How can I restore the databases and collections from the contents of my original mongoDB
data directory?Note - I am on the same computer, after a Windows 10 reset, and new install of MongoDB.
Related Questions
There are similar questions below, but they don't seem to provide an authoritative and accepted answer:
How to restore .wt backup file to local MongoDB?
How to copy wt files from another mongo instance?
https://stackoverflow.com/q/37557319
https://stackoverflow.com/q/32551549
Solution
Some sort of benevolent magic occurred after doing the following:
Remove MongoDB Community Edition as a Windows Service, see here.
Then when I went into my favourite MongoDB GUI (Robo3T), the databases were just there!
So i ran:
To get a "proper" dump of all my databases.
I'm confused how this could happen because the databases are still at their original location:
And the new MongoDB installation
¯_(ツ)_/¯
Atleast I have a proper
Remove MongoDB Community Edition as a Windows Service, see here.
sc.exe delete MongoDBThen when I went into my favourite MongoDB GUI (Robo3T), the databases were just there!
So i ran:
mongodumpTo get a "proper" dump of all my databases.
I'm confused how this could happen because the databases are still at their original location:
C:\data\And the new MongoDB installation
data location was:C:\Program Files\MongoDB\Server\4.0\data\ ¯_(ツ)_/¯
Atleast I have a proper
mongodump backup now.Code Snippets
sc.exe delete MongoDBContext
StackExchange Database Administrators Q#216759, answer score: 2
Revisions (0)
No revisions yet.