当前位置: 动力学知识库 > 问答 > 编程问答 >

node.js - How can i restore data from mongodb storage path /var/lib/mongodb/

问题描述:

I recently lost my mongodb data and do not have a backup. How can I restore data from mongodb dbPath having following content?


$ ls /var/lib/mongodb/


costats.0 costats-dev.0 costats-dev.ns costats.ns internalcrm.0 internalcrm.ns journal local.0 local.ns loopback.0 loopback.1 loopback.ns mongod.lock placeholder.0 placeholder.ns storage.bson _tmp

i want to restore data from loopback.0. Is it even possible?

网友答案:

If your data files are not deleted

mongod --dbpath /var/lib/mongodb/

This will start mongodb server with all your data. If data was curropted somehow, you can add --repair option

mongod --dbpath /var/lib/mongodb/ --repair

网友答案:

have u checked this ? I guess that if u have the xyz.0 db file it allows you to restore database thru above command.

分享给朋友:
您可能感兴趣的文章:
随机阅读: