<!-- 
RSS generated by JIRA (9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66) at Thu Feb 08 03:03:24 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-3560] CopyDB doesn&apos;t seem to work when copying from sharded db.</title>
                <link>https://jira.mongodb.org/browse/SERVER-3560</link>
                <project id="10000" key="SERVER">Core Server</project>
                    <description>&lt;p&gt;See &lt;a href=&quot;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBwQFjAA&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmongodb-user%2Fbrowse_thread%2Fthread%2F3a831d2675b0ec12&amp;amp;rct=j&amp;amp;q=google%20groups%20copydatabase%20failed&amp;amp;ei=mltBTvzrF4Hq0gHO-Om2CQ&amp;amp;usg=AFQjCNEAdHW-X8VFfuZ52talNbQ6GIyp7g&amp;amp;cad=rja&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.google.com/url?sa=t&amp;amp;source=web&amp;amp;cd=1&amp;amp;ved=0CBwQFjAA&amp;amp;url=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fmongodb-user%2Fbrowse_thread%2Fthread%2F3a831d2675b0ec12&amp;amp;rct=j&amp;amp;q=google%20groups%20copydatabase%20failed&amp;amp;ei=mltBTvzrF4Hq0gHO-Om2CQ&amp;amp;usg=AFQjCNEAdHW-X8VFfuZ52talNbQ6GIyp7g&amp;amp;cad=rja&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Copying is incomplete or does not happen at all.&lt;/p&gt;

&lt;p&gt;Workaround is to script something like:&lt;/p&gt;

&lt;p&gt;var mongoTo = mongod; var mongoFrom = mongos;&lt;br/&gt;
var collections = mongoFrom.getDB( &quot;test&quot; ).getCollectionNames()&lt;br/&gt;
var dbTo = &quot;test2&quot;; var dbFrom = &quot;test&quot;&lt;br/&gt;
var collections = mongoFrom.getDB( dbFrom ).getCollectionNames()&lt;br/&gt;
for( var i = 0; i &amp;lt; collections.length; i++ ){&lt;br/&gt;
  var cursor = mongoFrom.getCollection( dbFrom + &quot;.&quot; + collections&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt; ).find()&lt;br/&gt;
  while( cursor.hasNext() )&lt;/p&gt;
{
    mongoTo.getCollection( dbTo + &quot;.&quot; + collections[i] ).insert( cursor.next() )
  }
&lt;p&gt;}&lt;/p&gt;</description>
                <environment>at least ubuntu linux 10.10</environment>
        <key id="20752">SERVER-3560</key>
            <summary>CopyDB doesn&apos;t seem to work when copying from sharded db.</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="3">Duplicate</resolution>
                                        <assignee username="greg_10gen">Greg Studer</assignee>
                                    <reporter username="greg_10gen">Greg Studer</reporter>
                        <labels>
                    </labels>
                <created>Tue, 9 Aug 2011 16:12:07 +0000</created>
                <updated>Wed, 29 Feb 2012 03:53:55 +0000</updated>
                            <resolved>Thu, 29 Sep 2011 18:13:13 +0000</resolved>
                                    <version>1.8.2</version>
                                                                        <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="84994" author="scotthernandez" created="Fri, 3 Feb 2012 13:56:59 +0000"  >&lt;p&gt;This is not a good idea to do in javascript in 1.8.x as there are lots of data types which won&apos;t be kept through the transformation. You will not be able to keep full data fidelity. A good example of a missing type, or one that will change is an integer.&lt;/p&gt;

&lt;p&gt;It is much better to use a programming language with full data type support like java/.net/c/c++/python/ruby/etc.&lt;/p&gt;</comment>
                            <comment id="84932" author="1april" created="Fri, 3 Feb 2012 10:38:35 +0000"  >&lt;p&gt;I got the same problem with mongos and mongo 2.0.2&lt;/p&gt;

&lt;p&gt;I tried to copy a database from mongos on another machine.&lt;br/&gt;
Both have mongodb 2.0.2 and Debian GNU/Linux 6.0 in 64bit&lt;/p&gt;

&lt;p&gt;db.copyDatabase(&apos;mydb&apos;, &apos;mydb&apos;, &apos;mongos.server&apos;)&lt;/p&gt;

&lt;p&gt;Command hang on first collection after 81 copied objects.&lt;/p&gt;

&lt;p&gt;I modified the script a bit to work and to give me progress of everything and it works. Just takes long to copy hundreds of GB and millions of objects:&lt;/p&gt;

&lt;p&gt;var mongoTo = new Mongo; var mongoFrom = new Mongo(&apos;mongos.server&apos;);&lt;br/&gt;
var dbTo = &quot;mydb&quot;; var dbFrom = &quot;mydb&quot;;&lt;/p&gt;

&lt;p&gt;var collections = mongoFrom.getDB( dbFrom ).getCollectionNames();&lt;br/&gt;
printjson(collections);&lt;/p&gt;

&lt;p&gt;var steps;     &lt;br/&gt;
for( var i = 0; i &amp;lt; collections.length; i++ ){&lt;br/&gt;
  var cursor = mongoFrom.getCollection( dbFrom + &quot;.&quot; + collections&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt; ).find();&lt;br/&gt;
  var cnt=0;&lt;br/&gt;
  var total=cursor.count();&lt;br/&gt;
  steps=total&amp;gt;100?Math.round(total/100):100;&lt;br/&gt;
  printjson(&lt;/p&gt;
{collection: collections[i], total:total, steps:steps}
&lt;p&gt;);&lt;br/&gt;
  while( cursor.hasNext() ) {&lt;br/&gt;
    cnt++;&lt;br/&gt;
    mongoTo.getCollection( dbTo + &quot;.&quot; + collections&lt;span class=&quot;error&quot;&gt;&amp;#91;i&amp;#93;&lt;/span&gt; ).insert( cursor.next() );&lt;br/&gt;
    if(cnt%steps==0) printjson(&lt;/p&gt;
{collection: collections[i], curr: cnt, total:total, perc:(cnt/total*100).toFixed(1)}
&lt;p&gt;);&lt;br/&gt;
  }&lt;br/&gt;
}&lt;/p&gt;


</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10010">
                    <name>Duplicate</name>
                                            <outwardlinks description="duplicates">
                                        <issuelink>
            <issuekey id="12482">SERVER-1440</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                <customfield id="customfield_10050" key="com.atlassian.jira.toolkit:comments">
                        <customfieldname># Replies</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>2.0</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10055" key="com.atlassian.jira.ext.charting:firstresponsedate">
                        <customfieldname>Date of 1st Reply</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>Fri, 3 Feb 2012 10:38:35 +0000</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10052" key="com.atlassian.jira.toolkit:dayslastcommented">
                        <customfieldname>Days since reply</customfieldname>
                        <customfieldvalues>
                                        12 years, 2 weeks, 5 days 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>
                            12 years, 2 weeks, 5 days 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>1april</customfieldvalue>
            <customfieldvalue>greg_10gen</customfieldvalue>
            <customfieldvalue>scotthernandez</customfieldvalue>
    
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                        <customfield id="customfield_14254" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Product Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>1|hrou93:</customfieldvalue>

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

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10558" key="com.pyxis.greenhopper.jira:gh-global-rank">
                        <customfieldname>Rank (Obsolete)</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>23268</customfieldvalue>
                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_23361" key="com.onresolve.jira.groovy.groovyrunner:scripted-field">
                        <customfieldname>Requested By</customfieldname>
                        <customfieldvalues>
                                

                        </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|ht0d5b:</customfieldvalue>

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