ubuntu mongodb backup/restore (备份和恢复)

备份(导出)mongodb

1.导出单个collection-.json格式json

mongoexport --host:127.0.0.1 --port:27017 --db test --collection testcollection --out /xxx/testcollection.json
2.导出整个db的数据 --host 默认为127.0.0.1 --port 默认为27017rest

mongoexport --db test --out /xxx/
会生成一个dump文件夹文档


恢复get

mongorestore --db accounts dump/io


官方文档test

相关文章
相关标签/搜索