Restoring data from a MongoDB Export

To restore data from MongoDB Export files the command line application “mongoimport.exe” of MongoDB is used. Please refer to the MongoDB online help for all the details on available options when running this tool. Example to restore data to the production data store:

C:\inmation.root\MongoDB\bin\mongoimport.exe /db:History /collection:rawdata /file:c:\backups\MongoDB_Export_Prod.json

Example to restore data to the test data store:

C:\inmation.root\MongoDB\bin\mongoimport.exe /db:HistoryTest /collection:rawdata /file:c:\.backups\MongoDB_Export_Test.json

Restoring Data with Authentication Enabled

If restoring data with authentication it is necessary to specify the following details in the command line:

username

the username configured during setup or MongoDB security settings.

password

the password configured during setup or MongoDB security settings.

authenticationMechanism

the authentication mode configured during setup, MongoDB security settings. Default = SCRAM-SHA-1, other options here.

authenticationDatabase

the authentication database for the user, default = admin.

For example:

C:\inmation.root\MongoDB\bin\mongoimport.exe /db:History /collection:rawdata / username:system / password:password / authenticationMechanism:SCRAM-SHA-1 / authenticationDatabase:admin file:<PATH TO BACKUP FOLDER>\MongoDB_Export_Prod.json

For more information on the mongoimport options, please read the MongoDB documentation