<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:05:43 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>MongoDB Jira</title>
    <link>https://jira.mongodb.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>9.7.1</version>
        <build-number>970001</build-number>
        <build-date>13-04-2023</build-date>
    </build-info>


<item>
            <title>[SERVER-4345] mongorestore has no way to accept input from stdin</title>
                <link>https://jira.mongodb.org/browse/SERVER-4345</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;mongodump can output to stdout, but mongorestore appears to have no way to accept input from stdin. This makes it very difficult to pipe the output from mongodump to mongorestore to copy a collection from one server to another without writing the entire collection to a temporary file (potentially hundreds of GB).&lt;/p&gt;</description>
                <environment></environment>
        <key id="25264">SERVER-4345</key>
            <summary>mongorestore has no way to accept input from stdin</summary>
                <type id="1" iconUrl="https://jira.mongodb.org/secure/viewavatar?size=xsmall&amp;avatarId=14703&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.mongodb.org/images/icons/priorities/major.svg">Major - P3</priority>
                        <status id="6" iconUrl="https://jira.mongodb.org/images/icons/statuses/closed.png" description="The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.">Closed</status>
                    <statusCategory id="3" key="done" colorName="success"/>
                                    <resolution id="9">Done</resolution>
                                        <assignee username="benety.goh@mongodb.com">Benety Goh</assignee>
                                    <reporter username="fields">Adam Fields</reporter>
                        <labels>
                    </labels>
                <created>Mon, 21 Nov 2011 22:52:49 +0000</created>
                <updated>Tue, 8 Jul 2014 20:53:28 +0000</updated>
                            <resolved>Wed, 2 Jul 2014 21:00:07 +0000</resolved>
                                    <version>2.0.1</version>
                                    <fixVersion>2.7.3</fixVersion>
                                    <component>Tools</component>
                                        <votes>33</votes>
                                    <watches>29</watches>
                                                                                                                <comments>
                            <comment id="646456" author="xgen-internal-githook" created="Wed, 2 Jul 2014 20:58:04 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;benety&apos;, u&apos;name&apos;: u&apos;Benety Goh&apos;, u&apos;email&apos;: u&apos;benety@mongodb.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4345&quot; title=&quot;mongorestore has no way to accept input from stdin&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4345&quot;&gt;&lt;del&gt;SERVER-4345&lt;/del&gt;&lt;/a&gt; mongorestore will read from stdin when filename is &quot;-&quot;&lt;br/&gt;
            check eof only on fifo files. restored original logic of checking bytes read against file length.&lt;br/&gt;
            mongorestore requires both --db and --collection when using stdin/fifo&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/8ada5660746aa5aa351cc36e8d793cbc353c4fad&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/8ada5660746aa5aa351cc36e8d793cbc353c4fad&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="646455" author="xgen-internal-githook" created="Wed, 2 Jul 2014 20:58:01 +0000"  >&lt;p&gt;Author:&lt;/p&gt;
{u&apos;username&apos;: u&apos;azat&apos;, u&apos;name&apos;: u&apos;Azat Khuzhin&apos;, u&apos;email&apos;: u&apos;a3at.mail@gmail.com&apos;}
&lt;p&gt;Message: &lt;a href=&quot;https://jira.mongodb.org/browse/SERVER-4345&quot; title=&quot;mongorestore has no way to accept input from stdin&quot; class=&quot;issue-link&quot; data-issue-key=&quot;SERVER-4345&quot;&gt;&lt;del&gt;SERVER-4345&lt;/del&gt;&lt;/a&gt; Add support processing fifo files in mongorestore&lt;/p&gt;

&lt;p&gt;Example : `./mongorestore -d test -c foo_dupl &amp;lt;(mongodump -d test -c foo -out - 2&amp;gt;/dev/null | tail -n+2)`&lt;br/&gt;
Example (after pull #204) : `./mongorestore -d test -c foo_dupl &amp;lt;(mongodump -d test -c foo -out - 2&amp;gt;/dev/null)`&lt;/p&gt;

&lt;p&gt;This closes #205&lt;/p&gt;

&lt;p&gt;Signed-off-by: Benety Goh &amp;lt;benety@mongodb.com&amp;gt;&lt;br/&gt;
Branch: master&lt;br/&gt;
&lt;a href=&quot;https://github.com/mongodb/mongo/commit/962dae30460ca6c2a9115b2d950cc8f2f6120d54&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://github.com/mongodb/mongo/commit/962dae30460ca6c2a9115b2d950cc8f2f6120d54&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="491576" author="merickson@brightcove.com" created="Fri, 31 Jan 2014 17:21:51 +0000"  >&lt;p&gt;Additionally, the following doesn&apos;t work but should,&lt;/p&gt;

&lt;p/&gt;
&lt;div id=&quot;syntaxplugin&quot; class=&quot;syntaxplugin&quot; style=&quot;border: 1px dashed #bbb; border-radius: 5px !important; overflow: auto; max-height: 30em;&quot;&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;font-size: 1em; line-height: 1.4em !important; font-weight: normal; font-style: normal; color: black;&quot;&gt;
		&lt;tbody &gt;
				&lt;tr id=&quot;syntaxplugin_code_and_gutter&quot;&gt;
						&lt;td  style=&quot; line-height: 1.4em !important; padding: 0em; vertical-align: top;&quot;&gt;
					&lt;pre style=&quot;font-size: 1em; margin: 0 10px;  margin-top: 10px;   margin-bottom: 10px;  width: auto; padding: 0;&quot;&gt;&lt;span style=&quot;color: black; font-family: &apos;Consolas&apos;, &apos;Bitstream Vera Sans Mono&apos;, &apos;Courier New&apos;, Courier, monospace !important;&quot;&gt;mongorestore -h host -d db -c col &amp;lt;(zcat col.bson.gz)&lt;/span&gt;&lt;/pre&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
			&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;p/&gt;

&lt;p&gt;It fails immediately with &quot;don&apos;t know what to do with &lt;span class=&quot;error&quot;&gt;&amp;#91;/dev/fd/XX&amp;#93;&lt;/span&gt;&quot;&lt;/p&gt;</comment>
                            <comment id="440537" author="0x783czar" created="Mon, 14 Oct 2013 16:49:24 +0000"  >&lt;p&gt;I just want to cast my vote for this as well.  I am also leveraging mongodump&apos;s stdout capabilities to upload the dump to a backup server, and would like to be able to restore with this same workflow so as to avoid doubling the storage requirements.&lt;br/&gt;
Since the functionality to dump to stdout exists in mongodump, I believe the reverse should be possible with mongorestore.&lt;/p&gt;

&lt;p&gt;tl;dr = +1&lt;/p&gt;</comment>
                            <comment id="438755" author="dynnamitt" created="Thu, 10 Oct 2013 10:17:11 +0000"  >&lt;p&gt;vote vote vote&lt;/p&gt;</comment>
                            <comment id="394201" author="nathanpeck" created="Fri, 2 Aug 2013 04:37:33 +0000"  >&lt;p&gt;Adding my vote to this feature request. Like Mike Fellows I am piping the output of mongodump through Gzip. I am using a Node.js environment which is built from the ground up for asynchronous streams so it is a natural process to pipe the output of mongodump for a collection through gzip and client side encryption, then streaming the compressed and encrypted collection dump into a private Amazon S3 backup bucket.&lt;/p&gt;

&lt;p&gt;Now I&apos;m working on the reverse flow, with the file data downloading from the backup bucket on S3, decrypting, decompressing, but I can&apos;t pipe the dump back into mongorestore, and instead have no other option but to write it to disk and execute mongorestore on the disk file.&lt;/p&gt;

&lt;p&gt;This is unacceptable, especially for large dumps because it results in restoring using up gigabytes of disk space, causing significant wear and tear on our hard drives, and being very slow.&lt;/p&gt;</comment>
                            <comment id="311291" author="thorn.roby@harlandfs.com" created="Thu, 11 Apr 2013 17:21:14 +0000"  >&lt;p&gt;I would also find this useful. And copyCollection won&apos;t work with mongos.&lt;/p&gt;</comment>
                            <comment id="164673" author="dekellum" created="Fri, 14 Sep 2012 23:14:42 +0000"  >&lt;p&gt;I have the same use case for a fix to this as Mr Fellows above. In fact it makes restores much more difficult as the uncompressed dump would not even fit on a normal single host partition in our setup.  Please (re-)consider adding restore from stdout in the single collection case.&lt;/p&gt;

</comment>
                            <comment id="164605" author="mike.fellows" created="Fri, 14 Sep 2012 19:47:48 +0000"  >&lt;p&gt;We have a use case that would be helped by this feature.  We are backing up single collections using mongodump and piping the output to gzip.  On those occasions where a restore is needed we access the gzipped backup file and are currently required to ungzip the entire file, then use mongorestore to pull the collection in.  Our collections are quite large (many GBytes) and handling the uncompressed files can be inconvenient.  Streaming the file out of gunzip and directly into mongorestore would be more convenient.&lt;/p&gt;

&lt;p&gt;I would envision something like this (the mongodump step currently works fine):&lt;/p&gt;

&lt;p&gt;mongodump --db my_database --collection my_collection  --out - | gzip &amp;gt; my_collection.bson.gz&lt;br/&gt;
gunzip -c my_collection.bson.gz | mongorestore --db my_database --collection my_collection&lt;/p&gt;


&lt;p&gt;I understand that the larger issue is more complicated as both dump and restore are designed to work at the database level with multiple collections (and now indexes?) but thought I would mention this use case as well.&lt;/p&gt;</comment>
                            <comment id="163201" author="willwarren" created="Tue, 11 Sep 2012 23:30:27 +0000"  >&lt;p&gt;As part of my setup scripts for our mongo powered appliance, I too would like to be able to pipe from an imaging server over ssh to mongorestore&lt;/p&gt;</comment>
                            <comment id="161188" author="kuijsten" created="Thu, 6 Sep 2012 17:04:26 +0000"  >&lt;p&gt;Ran into the same problem.&lt;/p&gt;

&lt;p&gt;It&apos;s a very powerful thing to be able to sync a collection from production, over ssh, to a development machine (as already pointed out by Sergei Serdyuk).&lt;/p&gt;

&lt;p&gt;On a more general note.&lt;br/&gt;
It would be really nice if the commandline tools would adhere to standard unix philosophies like piping, using stdout and stderr in the right cases and reading configs (like passwords) from a configuration file.&lt;/p&gt;

&lt;p&gt;Currently I miss this power. Mongoexport is another example of a tool that clutters stdout with informational messages (leading to at least one error when piped to mongoimport) and is unable to read authentication credentials from a configuration file.&lt;/p&gt;</comment>
                            <comment id="85849" author="sserdyuk" created="Mon, 6 Feb 2012 22:25:14 +0000"  >&lt;p&gt;While it is true that it is somewhat limited to only one collection per run, using stdin would allow piping through ssh from a remote server. I just found this page because I&apos;ve tried to pipe data from one server to another without exposing mongodb on a public ip address. Piping over ssh is a very common practice.&lt;/p&gt;</comment>
                            <comment id="85286" author="sdr984" created="Sat, 4 Feb 2012 15:35:17 +0000"  >&lt;p&gt;Oops, thanks for pointing that out Scott.  With this and copyDatabase being available, I guess I don&apos;t see any major additional benefits of being able to pipe mongodump to mongorestore.&lt;/p&gt;</comment>
                            <comment id="85284" author="scotthernandez" created="Sat, 4 Feb 2012 15:26:22 +0000"  >&lt;p&gt;There is already a cloneCollection command to copy a collection to another server: &lt;a href=&quot;http://www.mongodb.org/display/DOCS/cloneCollection+Command&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.mongodb.org/display/DOCS/cloneCollection+Command&lt;/a&gt;&lt;/p&gt;</comment>
                            <comment id="85283" author="sdr984" created="Sat, 4 Feb 2012 15:18:28 +0000"  >&lt;p&gt;I agree this would be a nice feature, would take out an intermediary step.  An alternative that may be more palatable to you guys is adding the ability to specify a single collection on the copyDatabase command.  That would essentially allow the same behavior that is being requested here as well.&lt;/p&gt;</comment>
                            <comment id="68124" author="fields" created="Tue, 22 Nov 2011 01:54:30 +0000"  >&lt;p&gt;Also, if there are debug/status messages being output to stdout instead of stderr, doesn&apos;t that mean that the mongodump &quot;output to stdout&quot; option isn&apos;t working as it should be?&lt;/p&gt;</comment>
                            <comment id="68123" author="fields" created="Tue, 22 Nov 2011 01:52:47 +0000"  >&lt;p&gt;Aren&apos;t those just additional aspects to the bug that should be part of the fix? It seems like this is right on the verge of being really useful for archiving/migrating potentially very large collections.&lt;/p&gt;</comment>
                            <comment id="68094" author="scotthernandez" created="Mon, 21 Nov 2011 23:27:36 +0000"  >&lt;p&gt;This is not all that useful for more than a single collection; there is no binary delineator yet for between collections/dbs. There are also issues with debug/status text being output to stdOut.&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10011">
                    <name>Depends</name>
                                                                <inwardlinks description="is depended on by">
                                                        </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                                                <inwardlinks description="is duplicated by">
                                        <issuelink>
            <issuekey id="102749">TOOLS-133</issuekey>
        </issuelink>
            <issuelink>
            <issuekey id="17157">SERVER-3111</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10012">
                    <name>Related</name>
                                                                <inwardlinks description="is related to">
                                        <issuelink>
            <issuekey id="32098">TOOLS-23</issuekey>
        </issuelink>
                            </inwardlinks>
                                    </issuelinktype>
                            <issuelinktype id="10220">
                    <name>Tested</name>
                                            <outwardlinks description="tested by">
                                                        </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>18.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Mon, 21 Nov 2011 23:27:36 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        9 years, 33 weeks ago
    
                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_18254" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Dependencies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[]]></customfieldvalue>


                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_15850" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_10057" key="com.atlassian.jira.toolkit:lastusercommented">
                        <customfieldname>Last comment by Customer</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>true</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10056" key="com.atlassian.jira.toolkit:lastupdaterorcommenter">
                        <customfieldname>Last commenter</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>ian@mongodb.com</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_11151" key="com.atlassian.jira.toolkit:LastCommentDate">
                        <customfieldname>Last public comment date</customfieldname>
                        <customfieldvalues>
                            9 years, 33 weeks ago
                        </customfieldvalues>
                    </customfield>
                                                                                                                        <customfield id="customfield_10000" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Old_Backport</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10000"><![CDATA[No]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10032" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Operating System</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10026"><![CDATA[ALL]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_10051" key="com.atlassian.jira.toolkit:participants">
                        <customfieldname>Participants</customfieldname>
                        <customfieldvalues>
                                        <customfieldvalue>fields</customfieldvalue>
            <customfieldvalue>benety.goh@mongodb.com</customfieldvalue>
            <customfieldvalue>dekellum</customfieldvalue>
            <customfieldvalue>0x783czar</customfieldvalue>
            <customfieldvalue>xgen-internal-githook</customfieldvalue>
            <customfieldvalue>dynnamitt</customfieldvalue>
            <customfieldvalue>merickson@brightcove.com</customfieldvalue>
            <customfieldvalue>mike.fellows</customfieldvalue>
            <customfieldvalue>nathanpeck</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
            <customfieldvalue>sdr984</customfieldvalue>
            <customfieldvalue>sserdyuk</customfieldvalue>
            <customfieldvalue>thorn.roby@harlandfs.com</customfieldvalue>
            <customfieldvalue>kuijsten</customfieldvalue>
            <customfieldvalue>willwarren</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrokxj:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                <customfield id="customfield_12550" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2|hrfz53:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6052</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_10166" key="com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons">
                        <customfieldname>Tests Written</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10154"><![CDATA[Complete]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10053" key="com.atlassian.jira.ext.charting:timeinstatus">
                        <customfieldname>Time In Status</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                        <customfield id="customfield_22870" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Triagers</customfieldname>
                        <customfieldvalues>
                                

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                    <customfield id="customfield_14350" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>serverRank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hs7zin:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                    </customfields>
    </item>
</channel>
</rss>