[Database] mongodb mongodump and mongorestore
2011-06-20 13:55
633 查看
mongodb mongodump and mongorestore
abeen@localhost:/program/mongodb-1.4/bin$ mongodump --help
options:
--help produce help message
-h [ --host ] arg mongo host to connect to
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use (some commands)
-u [ --username ] arg username
-p [ --password ] arg password
--dbpath arg directly access mongod data files in this path,
instead of connecting to a mongod instance
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
-o [ --out ] arg (=dump) output directory
Example:
1 #!/bin/sh
2
3 rm -rf /home/abeen/z_abeen_back/database_back/*
4 cd /program/mongodb-1.4/bin
5 ./mongodump -h 192.168.1.3 -d test -o /home/abeen/z_abeen_back/database_back
6 exit 0
abeen@localhost:/program/mongodb-1.4/bin$ mongorestore --help
usage: /usr/lib/mongodb/mongorestore [options] [directory or filename to restore from]
options:
--help produce help message
-h [ --host ] arg mongo host to connect to
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use (some commands)
-u [ --username ] arg username
-p [ --password ] arg password
--dbpath arg directly access mongod data files in this path,
instead of connecting to a mongod instance
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
Example:
mongorestore -h 92.168.1.3 --directoryperdb /home/abeen/z_abeen_back/database_back/test
abeen@localhost:/program/mongodb-1.4/bin$ mongodump --help
options:
--help produce help message
-h [ --host ] arg mongo host to connect to
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use (some commands)
-u [ --username ] arg username
-p [ --password ] arg password
--dbpath arg directly access mongod data files in this path,
instead of connecting to a mongod instance
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
-o [ --out ] arg (=dump) output directory
Example:
1 #!/bin/sh
2
3 rm -rf /home/abeen/z_abeen_back/database_back/*
4 cd /program/mongodb-1.4/bin
5 ./mongodump -h 192.168.1.3 -d test -o /home/abeen/z_abeen_back/database_back
6 exit 0
abeen@localhost:/program/mongodb-1.4/bin$ mongorestore --help
usage: /usr/lib/mongodb/mongorestore [options] [directory or filename to restore from]
options:
--help produce help message
-h [ --host ] arg mongo host to connect to
-d [ --db ] arg database to use
-c [ --collection ] arg collection to use (some commands)
-u [ --username ] arg username
-p [ --password ] arg password
--dbpath arg directly access mongod data files in this path,
instead of connecting to a mongod instance
-v [ --verbose ] be more verbose (include multiple times for more
verbosity e.g. -vvvvv)
Example:
mongorestore -h 92.168.1.3 --directoryperdb /home/abeen/z_abeen_back/database_back/test
相关文章推荐
- 【MongoDB】mongodump and mongorestore of mogodb
- 【MongoDB】mongodump and mongorestore of mogodb
- mongodump and mongorestore
- Mongodb的备份/还原 mongodump/mongorestore
- Backup and Restore MySQL Database Using mysqldump
- Backup and Restore MySQL Database Using mysqldump
- 温故而知新(二):”Using Flashback Database and Restore Points“ Translate & Notes
- Use Dump and Restore for Linux Backup
- Using Flashback Database and Restore Points
- MongoDB - Introduction to MongoDB, Databases and Collections
- Copy database via backup and restore
- Step By Step Guide To Create Physical Standby Database Using RMAN Backup and Restore (Doc ID 469493.
- mongo启动异常-mongodb exception in initAndListen: 7026old lock file, terminating
- PostgreSQL pg_dump pg_dumpall and restore
- MongoDB, Cassandra, and HBase -- the three NoSQL databases to watch
- 【MongoDB】mongoimport and mongoexport of data (二)
- How to backup and restore database in SQL Server
- mongo db dump&restore(备忘)
- Transfer postgres database to another server - backup and restore
- C# restore database and create user