Rahul Babu
Rahul Babu

Reputation: 790

Unable to import mongodump with mongorestore command

Trying to import mongo database from dump.Have a folder named iat which contains all the bson and json files to be imported. Example content of the folder is as below:

-rw-r--r--  1 rahul  staff       73 Sep 12 03:42 BaseBundle:Includes1Guest,1Content.10.discovery.bson.gz
-rw-r--r--  1 rahul  staff      229 Sep 12 03:42 BaseBundle:Includes1Guest,1Content.10.discovery.metadata.json.gz
-rw-r--r--  1 rahul  staff       76 Sep 12 03:42 BaseBundle:Includes1Guest,1Content.10.provisioning.bson.gz
-rw-r--r--  1 rahul  staff      234 Sep 12 03:42 BaseBundle:Includes1Guest,1Content.10.provisioning.metadata.json.gz
-rw-r--r--  1 rahul  staff       73 Sep 12 03:42 BaseBundle:Includes1Guest,1Content.15.discovery.bson.gz

Trying to use the command to import dbdump :

mongorestore --db dbName iat/

Getting the below errors :

2015-09-14T12:31:54.641+0530    building a list of collections to restore from iat/ dir
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.10.discovery.bson.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.10.discovery.metadata.json.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.10.provisioning.bson.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.10.provisioning.metadata.json.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.15.discovery.bson.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.15.discovery.metadata.json.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.15.provisioning.bson.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.15.provisioning.metadata.json.gz", skipping...
2015-09-14T12:31:54.645+0530    don't know what to do with file "iat/BaseBundle:Includes1Guest,1Content.16.discovery.bson.gz", skipping...

Upvotes: 4

Views: 1645

Answers (1)

Eli Borodach
Eli Borodach

Reputation: 597

You don't have to decompress, simply use --gzip in the command

Upvotes: 5

Related Questions