Skip to content

Commit 73446ed

Browse files
Zack BrownSam Kleinman
Zack Brown
authored and
Sam Kleinman
committed
DOCS-1529: copyDB not supported in 2.4 with auth
Signed-off-by: Sam Kleinman <[email protected]>
1 parent d257490 commit 73446ed

File tree

2 files changed

+107
-15
lines changed

2 files changed

+107
-15
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
object:
2+
name: copydb
3+
type: dbcommand
4+
field:
5+
optional: true
6+
type: field
7+
name: fromhost
8+
type: string
9+
position: 2
10+
description: |
11+
Hostname of the source :program:`mongod` instance. If omitted,
12+
:dbcommand:`copydb` copies one database to another within a single
13+
MongoDB instance.
14+
---
15+
object:
16+
name: copydb
17+
type: dbcommand
18+
field:
19+
optional: false
20+
type: field
21+
name: fromdb
22+
type: string
23+
position: 3
24+
description: |
25+
Name of the source database.
26+
---
27+
object:
28+
name: copydb
29+
type: dbcommand
30+
field:
31+
optional: false
32+
type: field
33+
name: todb
34+
type: string
35+
position: 4
36+
description: |
37+
Name of the target namespace.
38+
---
39+
object:
40+
name: copydb
41+
type: dbcommand
42+
field:
43+
optional: true
44+
type: field
45+
name: slaveOk
46+
type: boolean
47+
position: 5
48+
description: |
49+
Set ``slaveOK`` to ``true`` to allow :dbcommand:`copydb` to copy data from
50+
secondary members as well as the primary. ``fromhost`` must also be
51+
set.
52+
---
53+
object:
54+
name: copydb
55+
type: dbcommand
56+
field:
57+
optional: true
58+
type: field
59+
name: username
60+
type: string
61+
position: 6
62+
description: |
63+
The username credentials on the ``fromhost`` MongoDB deployment.
64+
---
65+
object:
66+
name: copydb
67+
type: dbcommand
68+
field:
69+
optional: true
70+
type: field
71+
name: nonce
72+
type: string
73+
position: 7
74+
description: |
75+
A one-time password that you request from the remote server using the
76+
:dbcommand:`copydbgetnonce` command.
77+
---
78+
object:
79+
name: copydb
80+
type: dbcommand
81+
field:
82+
optional: true
83+
type: field
84+
name: key
85+
type: string
86+
position: 8
87+
description: |
88+
A hash of the password used for authentication.
89+
...

source/reference/command/copydb.txt

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@ copydb
77
.. dbcommand:: copydb
88

99
The :dbcommand:`copydb` command copies a database from a remote
10-
host to the current host. The command has the following syntax:
10+
host to the current host. :dbcommand:`copydb` accepts the following
11+
options:
12+
13+
.. include:: /reference/command/copydb-fields.rst
14+
15+
:dbcommand:`copydb` has the following syntax:
1116

1217
.. code-block:: javascript
1318

@@ -20,30 +25,28 @@ copydb
2025
nonce: <nonce>,
2126
key: <key> }
2227

23-
All of the following arguments are optional:
24-
25-
- slaveOk
26-
- username
27-
- nonce
28-
- key
29-
30-
You can omit the ``fromhost`` argument, to copy one database to
31-
another database within a single MongoDB instance.
32-
33-
You must run this command on the destination, or the ``todb``
34-
server.
28+
Behavior
29+
--------
3530

3631
Be aware of the following behaviors:
3732

38-
- :dbcommand:`copydb` can run against a :term:`slave` or a
33+
- :dbcommand:`copydb` cannot be used by users whose privileges
34+
were set with the new :doc:`role-based user documents
35+
</reference/user-privileges/>` that were introduced in 2.4.
36+
To use :dbcommand:`copydb` with access control enabled
37+
you must use the :doc:`legacy user privilege documents
38+
</reference/privilege-documents/>` from v2.2 and prior.
39+
40+
- :dbcommand:`copydb` can run against a :term:`secondary` or a
3941
non-:term:`primary` member of a :term:`replica set`. In this case,
4042
you must set the ``slaveOk`` option to ``true``.
4143

4244
- :dbcommand:`copydb` does not snapshot the database. If the state
4345
of the database changes at any point during the operation, the
4446
resulting database may be inconsistent.
4547

46-
- You must run :dbcommand:`copydb` on the **destination server**.
48+
- You must run :dbcommand:`copydb` on the **destination server**, i.e. the
49+
host receiving the copied data.
4750

4851
- The destination server is not locked for the duration of the
4952
:dbcommand:`copydb` operation. This means that

0 commit comments

Comments
 (0)