设为首页 加入收藏

TOP

MongoDB导出-导入-迁移(一)
2014-11-24 07:48:03 来源: 作者: 【 】 浏览:11
Tags:MongoDB 导出 导入 迁移
MongoDB导出-导入-迁移
linux环境下,将mongodb迁移到同机器,不同端口上。
命令参数:
[mongodb@pera bin]$ ./mongodump --help
Export MongoDB data to BSON files.
options:
--help produce help message
-v [ --verbose ] be 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 ( /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 toa mongod server -
needs to lock the datadirectory, so cannot be used
if a mongod is currentlyaccessing the same path
--directoryperdb if dbpath specified, each db is in a separate
directory
--journal enable journaling
-d [ --db ] arg database to use
-c [ --collection ] arg collectionto use (some commands)
-o [ --out ] arg (=dump) output directoryor "-" 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 (do not use $snapshot)
[mongodb@pera bin]$ ./mongorestore --help
Import BSON files into MongoDB.
usage: ./mongorestore [options] [directory or filenameto restore from]
options:
--help produce help message
-v [ --verbose ] be 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 ( /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 amongod server -
needs to lock the data directory, socannot be used
if a mongod is currently accessingthe same path
--directoryperdb if dbpath specified, each db is in a separate
directory
--journal enable journaling
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use(some commands)
--objcheck validate object before inserting
--filter arg filter to apply before inserting
--drop drop each collection before import
--oplogReplay replay oplog for point-in-time restore
--oplogLimit arg exclude oplog entries newer than provided timestamp
(epoch[:ordinal])
--keepIndexVersion don't upgrade indexes to newest version
--noOptionsRestore don't restore collection options
--noIndexRestore don't restore indexes
--w arg (=1) minimum number of replicas per write
主机信息:
[root@pera ~]# more /etc/redhat-release
Red Hat Enterprise Linux Server release 5.6(Tikanga)
[root@pera ~]# uname -a
Linux pera 2.6.18-238.el5xen #1 SMP Sun Dec 1914:42
首页 上一页 1 2 3 下一页 尾页 1/3/3
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇postgresql启动错误 下一篇mongodb常用语句(集合操作)

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)
·MySQL下载与安装教程 (2025-12-26 13:21:26)
·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)