几个月前,我对 mongodump 数据库进行了转储,结果生成了一个文件,而不是多个 bson 和 json 文件:
我尝试使用以下方法恢复它:
mongorestore --drop --db lodeep 转储
dump 是包含该文件的文件夹,但我得到这个:
我不记得我到底是如何制作这个转储的。以及为什么它不像通常的垃圾场。以及为什么该文件没有扩展名。我有点失落。我真的需要这些数据。
当我这样做时:
头 mongodump-prod-db
请问有什么帮助吗?
您可以使用命令恢复单个文件转储
mongorestore --drop < dump.gz
数据库名称将从文件中获取。如果您在执行转储时使用了
--archive
标志,则必须将该选项添加到恢复命令中。