Transfer MongoDB collection to Windows
A quick’n’dirty1 way for transferring MongoDB collection from Linux to Windows, using plink as the ssh client.
bash
plink -load null username@remotehost ^
mongoexport --db mydb --collection mycollection | ^
mongoimport --db mydb --collection mycollection
If you have set up the key-based authentication for SSH and are using pageant to manage the key locally, this does not prompt for a password. -load null
forces plink to ignore the hostname defined in your default PuTTY session profile.
[1] dirty because mongoexport does not transfer all datatypes, in order to really transfer everything you should create the export with mongodump.