Import and export of MONGO databases

Source: Internet
Author: User
Tags server port mongodump

http://www.iwangzheng.com/



[[email protected]] $show dbs;
Changhong_tv_cms 0.078gb[[email protected]]$ mongodump-d changhong_tv_cms-o/temp/db_mongo.20140521.mongo/ workspace/db_baks$ scp-r-P 22022[email protected]:/temp/db_mongo_changhong.20140521.mongo./workspace/db_ baks$ Mongorestore--directoryperdbdb_mongo_changhong.20140521.mongo

$ mongodump--help

Options
--HELP Produce Help message
-V [--verbose] is more verbose (include multiple times for more
verbosity e.g.-VVVVV)
--version Print the program ' s version and exit
-h [--host] arg MONGO host to connect to (<set name>/s1,s2 for
Sets)
--port ARG server port. Can also use--host hostname:port
--ipv6 Enable IPV6 support (disabled by default)
-U [--username] arg username
-P [--password] arg password
--dbpath arg directly access Mongod database files in the given
Path, instead of connecting to a Mongod server-
Needs to lock the data directory, so cannot is used
If a mongod is currently accessing the same path
--directoryperdb if dbpath specified, each db was in a separate
Directory
--journal Enable journaling
-d [--DB] arg database to use
-c [--collection] arg collection to use (some commands)
-O [--out] arg (=dump) output directory or "-" for stdout
-Q [--query] arg JSON query
--oplog use Oplog for Point-in-time snapshotting
--repair try to recover a crashed database
--forcetablescan Force a table scan (does not use $snapshot)

-H Export Source
-d database name to export
The location to export the-o database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.