Skip to content

DOCS-137 2nd pass at backup.rst #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions source/administration/backups.rst
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ Database Export with mongodump

The :program:`mongodump` utility performs a live backup the data, or
can work against an inactive set of database
files. :program:`mongodump` utility can create a dump for an entire
server/database/collection (or part of a collection with a query,)
files. The :program:`mongodump` utility can create a dump for an entire
server/database/collection (or part of a collection using of query,)
even when the database is running and active. If you run
:program:`mongodump` without any arguments the command will connect to
the local database instance (e.g. ``127.0.0.1`` or ``localhost``) and
Expand All @@ -441,6 +441,8 @@ database named "``test``". :program:`mongodump` provides the
operation to use the operation log to take a point-in-time snapshot of
the database.

TODO: We need to explain how this works. Can help you on this tmrw.

If your MongoDB instance is not running, you can use the
":option:`--dbpath <mongodump --dbpath>`" option to specify the
location to your MongoDB instance's database files. :program:`mongodump`
Expand Down Expand Up @@ -469,15 +471,15 @@ and password credentials to specify database authentication.
Database Import with mongorestore
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The :program:`mongorestore` restores a binary backup created by the
:program:`mongodump` utility. Consider the following example command:
The :program:`mongorestore` utility restores a binary backup created by
:program:`mongodump`. Consider the following example command:

.. code-block:: sh

mongorestore dump-2011-10-25/

Here, :program:`mongorestore` imports the database backup located in
the ``dump-2011-10-25`` directory to the :option:``mongod` instance
the ``dump-2011-10-25`` directory to the :option:`mongod` instance
running on the localhost interface. By default, :program:`mongorestore`
will look for a database dump in the "``dump/``" directory and restore
that. If you wish to restore to a non-default host, the
Expand All @@ -494,7 +496,7 @@ username and password credentials as above.

If you created your database dump using the :option:`--oplog
<mongodump --oplog>` option to ensure a point-in-time snapshot, call
:program:`mongorestore` with the ":option:` --oplogReplay <mongorestore
:program:`mongorestore` with the ":option:`--oplogReplay <mongorestore
--oplogReplay>`" option as in the following example:

.. code-block:: sh
Expand All @@ -513,12 +515,15 @@ following example:

mongorestore --filter '{"field": 1}'

Here, :program:`mognorestore` only adds documents to the database from
Here, :program:`mongorestore` only adds documents to the database from
the dump located in the "``dump/``" folder *if* the documents have a
field name "``field``" that holds a value of "``1``". Enclose the
filter in single quotes (e.g. "``'``") to prevent the filter from
interacting with your shell environment.

TODO: You already referenced --dbpath option above, but this actually
seems more fleshed out..

If your MongoDB instance is not running, you can use the
":option:`mongorestore --dbpath`" option to specify the location to
your MongoDB instance's database files. :program:`mongorestore` inserts
Expand All @@ -532,6 +537,8 @@ configuration. Consider the following example:

mognorestore --dbpath /srv/mongodb

TODO: third ref to --dbpath

If your MongoDB instance is not running, you can use the
":option:`--dbpath <mongorestore --dbpath>`" option to specify the
location to your MongoDB instance's database files. Consider using the
Expand Down