Issue with restoring gzip compressed collections

652 views
Skip to first unread message

Rhys Campbell

unread,
Nov 24, 2016, 11:09:42 AM11/24/16
to mongodb-user
I am backing up collections with the following command...

mongodump --authenticationDatabase admin --db XXXXX --collection XXXXX --port 27017 --username XXXXX --password XXXXX --gzip --archive=rhys.gz

I have attempted restoring with...

mongorestore --authenticationDatabase admin --db XXXXX --collection XXXXX -u admin --passwordXXXXX --gzip --archive rhys.gz

mongorestore --authenticationDatabase admin -u XXXXX --password XXXXX --gzip --archive rhys.gz

And a few other variations but the command just sits there appearing to hang. Nothing is ever outputted.

I have been reading about the issues in the following jira ticket...


So I'm aware there's a few issue around the naming of the files, colelctions and so on but I've modified my commands to account for this. Can anyone explain what's happening here?

I am running MongoDB V3.2.8

Cheers,

Rhys




Kevin Adistambha

unread,
Nov 24, 2016, 5:02:37 PM11/24/16
to mongodb-user

Hi Rhys

mongorestore —authenticationDatabase admin -u XXXXX —password XXXXX —gzip —archive rhys.gz

I believe what happened is you have no equal sign (=) between the parameter --archive and the filename rhys.gz, which makes mongorestore to wait for an input from stdin indefinitely.

You may also need to add the --gzip parameter to restore from a compressed archive (see Restore from Compressed Data)

I tested this command in MongoDB 3.2.11 and it seems to work as expected:

mongorestore --authenticationDatabase admin --db XXXX --collection XXXX -u user -p password --gzip --archive=test.gz

Please note that you can specify a --verbose option in both mongodump and mongorestore to print more information to the console.

Best regards,
Kevin

Rhys Campbell

unread,
Nov 28, 2016, 7:20:07 AM11/28/16
to mongodb-user
That's it. Perfect, thank you.
Reply all
Reply to author
Forward
0 new messages