mongoDB备份与恢复
2017-08-27 18:40
246 查看
同事整理的命令,经常用到拿过来记录一下。
备份
mongodump --host dds-m5b42.mongodb.rds.aliyuncs.com:3717 --authenticationDatabase admin -u root -p [password] -d [db] -o /www/db
恢复
mongorestore --host dds-mb42.mongodb.rds.aliyuncs.com:3717 --authenticationDatabase admin -u root -p [password] -d [db] /www/db/game_center
备份Collection
mongodump --host dds-m842.mongodb.rds.aliyuncs.com:3717 --authenticationDatabase admin -u root -p [password] -d [db] -c [collection] -o /www/db
恢复Collection
mongorestore --host dds-m511b.mongodb.rds.aliyuncs.com:3717 --authenticationDatabase admin -u root -p [password] -d [db] -c [collection] /www/db/game_center/[collection.bson]
参数
-h or --host: mongodb // mongo连接地址 -u: username // 用户名 -p: password // 密码 -d: database // 要备份的数据库 或 要恢复的数据库名称 -c: collection // 要备份的collection 或 要恢复的collection -o: savepath // 备份数据保存位置
相关文章推荐
- mongodb的备份与恢复
- MongoDB:mongodb的备份和恢复
- mongodb全库备份与恢复
- Mongodb 备份与恢复
- MongoDB的备份与恢复
- mongodb时间点备份恢复
- mongodb 备份和恢复
- MongoDB数据库的文件备份恢复以及文件导入导出
- 通过mongodump和mongorestore实现Mongodb备份和恢复
- Mongodb 备份与恢复
- MongoDB 数据备份、恢复与迁移管理
- MongoDB 数据备份 mongodump 和数据恢复mongorestore
- MongoDB的备份与恢复
- Mongodb的备份与恢复
- Mongodb 备份和恢复
- MongoDB 备份(mongodump)与恢复(mongorestore)
- 菜鸟的mongoDB学习---(七)MongoDB 备份(mongodump)与恢复(mongorerstore)
- mongoDB之数据备份恢复工具
- MongoDB 备份(mongodump)与恢复(mongorestore)
- mongodb 如何导入导出备份恢复