{"action":"created","issue":{"url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/11","labels_url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/11/comments","events_url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/11/events","html_url":"https://github.com/punkave/mongo-dump-stream/issues/11","id":124063229,"number":11,"title":"mongo-load-stream doesn't do anything","user":{"login":"kramer65","id":596581,"avatar_url":"https://avatars.githubusercontent.com/u/596581?v=3","gravatar_id":"","url":"https://api.github.com/users/kramer65","html_url":"https://github.com/kramer65","followers_url":"https://api.github.com/users/kramer65/followers","following_url":"https://api.github.com/users/kramer65/following{/other_user}","gists_url":"https://api.github.com/users/kramer65/gists{/gist_id}","starred_url":"https://api.github.com/users/kramer65/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kramer65/subscriptions","organizations_url":"https://api.github.com/users/kramer65/orgs","repos_url":"https://api.github.com/users/kramer65/repos","events_url":"https://api.github.com/users/kramer65/events{/privacy}","received_events_url":"https://api.github.com/users/kramer65/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-28T12:41:37Z","updated_at":"2015-12-28T12:57:15Z","closed_at":null,"body":"I'm quite thrilled that I found mongo-dump-stream and I'm currently testing it out. From a remote server Ubuntu 14.04 I've successfully dumped our production mongodb into a file on a backup server (alsuo Ubuntu 14.04) using\r\n\r\n    ssh -C ubuntu@52.xx.xx.xxx mongo-dump-stream mongodb://127.0.0.1:27017/thedatabase | gzip -c > mongodb.gz\r\n\r\nthis created a file of 2.4 GB:\r\n```\r\n$ ls -lh\r\ntotal 2.4G\r\n-rw-rw-r-- 1 ubuntu ubuntu 2.4G Dec 24 15:46 mongodb.gz\r\n```\r\nI now want to load this stream into the mongodb of the backup server, which I try using:\r\n\r\n    gunzip -c mongodb.gz | mongo-load-stream mongodb://127.0.0.1:27017/thebackup\r\n\r\nThis command gives no error and ends within a second. But when I open the mongo shell I don't see the expected `thebackup` database:\r\n```\r\n$ mongo\r\nMongoDB shell version: 2.4.9\r\nconnecting to: test\r\n> show dbs;\r\nlocal\t0.078125GB\r\n```\r\nTo make sure the unzipping goes well I tried `gunzip`ing the file first and if I pipe it through `less` (`gunzip -c mongodb.gz | less`) I see the following:\r\n```\r\n\r\n{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }\r\nR^@^@^@^Btype^@^R^@^@^@mongo-dump-stream^@^Bversion^@^B^@^@^@2^@^BendOfCollection^@^M^@^@^@C42uzh+cSiI=^@^@<95>^@^@^@^Btype^@^K^@^@^@collection^@^Bname^@^N^@^@^@user_document^@^Dindexes^@Z^@^@^@^C0^@R^@^@^@^Pv^@^A^@^@^@^Ckey^@^N^@^@^@^P_id^@^A^@^@^@^@^Bns^@^\\^@^@^@ticketcatcher.user_document^@^Bname^@^E^@^@^@_id_^@^@^@^@<A1>^E^@^@^G_id^@V^ER-<F7>!<F5>^H!<80>        N       created^@ ^@<C9>^DP^A^@^@^Bfilename^@^A^@^@^@^@^Ebinary^@4^E^@^@^@<FF><D8><FF><E0>^@^PJFIF^@^A^B^@^@^A^\r\n```\r\nI don't know if the error on the first line is a problem, but it seems to extract perfectly fine into a file of 2.9GB\r\n\r\nI also tried piping the extracted mongodb file to mongo-load-streamwith `cat mongodb | mongo-load-stream mongodb://127.0.0.1:27017/thebackup`, but with the same result; it finishes immediately and nothing seems to be imported in mongodb.\r\n\r\nDoes anybody know why `mongo-load-stream` doesn't seem to do anything for me? All tips are welcome!"},"comment":{"url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/comments/167564433","html_url":"https://github.com/punkave/mongo-dump-stream/issues/11#issuecomment-167564433","issue_url":"https://api.github.com/repos/punkave/mongo-dump-stream/issues/11","id":167564433,"user":{"login":"boutell","id":32125,"avatar_url":"https://avatars.githubusercontent.com/u/32125?v=3","gravatar_id":"","url":"https://api.github.com/users/boutell","html_url":"https://github.com/boutell","followers_url":"https://api.github.com/users/boutell/followers","following_url":"https://api.github.com/users/boutell/following{/other_user}","gists_url":"https://api.github.com/users/boutell/gists{/gist_id}","starred_url":"https://api.github.com/users/boutell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boutell/subscriptions","organizations_url":"https://api.github.com/users/boutell/orgs","repos_url":"https://api.github.com/users/boutell/repos","events_url":"https://api.github.com/users/boutell/events{/privacy}","received_events_url":"https://api.github.com/users/boutell/received_events","type":"User","site_admin":false},"created_at":"2015-12-28T12:57:15Z","updated_at":"2015-12-28T12:57:15Z","body":"First line is definitely a problem. It's an error message and not part of\nthe data. Not sure why node wrote it to stdout rather than stderr which\npretty much guarantees wrecked output. But it's not an error in\nmongo-dump-stream itself.\nOn Dec 28, 2015 7:41 AM, \"kramer65\" <notifications@github.com> wrote:\n\n> I'm quite thrilled that I found mongo-dump-stream and I'm currently\n> testing it out From a remote server Ubuntu 1404 I've successfully dumped\n> our production mongodb into a file on a backup server (alsuo Ubuntu 1404)\n> using\n>\n> ssh -C ubuntu@52xxxxxxx mongo-dump-stream mongodb://127001:27017/thedatabase | gzip -c > mongodbgz\n>\n> this created a file of 24 GB:\n>\n> $ ls -lh\n> total 24G\n> -rw-rw-r-- 1 ubuntu ubuntu 24G Dec 24 15:46 mongodbgz\n>\n> I now want to load this stream into the mongodb of the backup server,\n> which I try using:\n>\n> gunzip -c mongodbgz | mongo-load-stream mongodb://127001:27017/thebackup\n>\n> This command gives no error and ends within a second But when I open the\n> mongo shell I don't see the expected thebackup database:\n>\n> $ mongo\n> MongoDB shell version: 249\n> connecting to: test\n> > show dbs;\n> local   0078125GB\n>\n> To make sure the unzipping goes well I tried gunziping the file first and\n> if I pipe it through less (gunzip -c mongodbgz | less) I see the\n> following:\n>\n>\n> { [Error: Cannot find module '/build/Release/bson'] code: 'MODULE_NOT_FOUND' }\n> R^@^@^@^Btype^@^R^@^@^@mongo-dump-stream^@^Bversion^@^B^@^@^@2^@^BendOfCollection^@^M^@^@^@C42uzh+cSiI=^@^@<95>^@^@^@^Btype^@^K^@^@^@collection^@^Bname^@^N^@^@^@user_document^@^Dindexes^@Z^@^@^@^C0^@R^@^@^@^Pv^@^A^@^@^@^Ckey^@^N^@^@^@^P_id^@^A^@^@^@^@^Bns^@^\\^@^@^@ticketcatcheruser_document^@^Bname^@^E^@^@^@_id_^@^@^@^@<A1>^E^@^@^G_id^@V^ER-<F7>!<F5>^H!<80>        N       created^@ ^@<C9>^DP^A^@^@^Bfilename^@^A^@^@^@^@^Ebinary^@4^E^@^@^@<FF><D8><FF><E0>^@^PJFIF^@^A^B^@^@^A^\n>\n> I don't know if the error on the first line is a problem, but it seems to\n> extract perfectly fine into a file of 29GB\n>\n> I also tried piping the extracted mongodb file to mongo-load-streamwith cat\n> mongodb | mongo-load-stream mongodb://127001:27017/thebackup, but with\n> the same result; it finishes immediately and nothing seems to be imported\n> in mongodb\n>\n> Does anybody know why mongo-load-stream doesn't seem to do anything for\n> me? All tips are welcome!\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/punkave/mongo-dump-stream/issues/11>.\n>\n"}}