V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐工具
RoboMongo
推荐书目
50 Tips and Tricks for MongoDB Developers
Related Blogs
Snail in a Turtleneck
sadfQED2
V2EX  ›  MongoDB

江湖救急,冷备数据恢复

  •  
  •   sadfQED2 · 2023-11-28 17:23:49 +08:00 · 1815 次点击
    这是一个创建于 389 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有一份 4 年前的 Mongodb 冷备数据,现在需要恢复出来使用。4 年前留下的是一个 tar 格式的文件,19G 大小,预览文件内容是这样的:

    mongodb/
    mongodb/WiredTiger.lock
    mongodb/index-3--2162478702715552952.wt
    mongodb/diagnostic.data/
    mongodb/diagnostic.data/metrics.2019-11-12T20-37-31Z-00000
    mongodb/diagnostic.data/metrics.2019-12-03T12-08-23Z-00000
    mongodb/diagnostic.data/metrics.2019-11-26T13-42-24Z-00000
    mongodb/diagnostic.data/metrics.2019-12-05T17-38-23Z-00000
    mongodb/diagnostic.data/metrics.2019-11-15T02-22-31Z-00000
    mongodb/diagnostic.data/metrics.2019-12-01T03-58-23Z-00000
    mongodb/diagnostic.data/metrics.2019-11-04T12-04-09Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-32-45Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-22-27Z-00000
    mongodb/diagnostic.data/metrics.2019-11-20T17-17-16Z-00000
    mongodb/diagnostic.data/metrics.2019-11-08T14-42-31Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-27-58Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-33-52Z-00000
    mongodb/diagnostic.data/metrics.2019-11-10T20-37-31Z-00000
    mongodb/diagnostic.data/metrics.2019-11-23T05-48-39Z-00000
    mongodb/diagnostic.data/metrics.2019-11-22T23-37-16Z-00000
    mongodb/diagnostic.data/metrics.2019-11-04T10-51-02Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-37-15Z-00000
    mongodb/diagnostic.data/metrics.2019-11-06T09-32-31Z-00000
    mongodb/diagnostic.data/metrics.2019-12-10T06-10-22Z-00000
    mongodb/diagnostic.data/metrics.2019-11-18T12-06-17Z-00000
    mongodb/diagnostic.data/metrics.2019-12-07T23-00-22Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-24-19Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-26-23Z-00000
    mongodb/diagnostic.data/metrics.2019-11-28T20-58-23Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T10-08-45Z-00000
    mongodb/diagnostic.data/metrics.2019-11-03T09-39-15Z-00000
    mongodb/_mdb_catalog.wt
    mongodb/collection-0--2162478702715552952.wt
    mongodb/collection-4--6287796740362363623.wt
    mongodb/index-5--2162478702715552952.wt
    mongodb/journal/
    mongodb/journal/WiredTigerPreplog.0000000001
    mongodb/journal/WiredTigerPreplog.0000000002
    mongodb/journal/WiredTigerLog.0000000434
    mongodb/WiredTiger.wt
    mongodb/collection-2--4216008088303394775.wt
    mongodb/WiredTigerLAS.wt
    mongodb/WiredTiger.turtle
    mongodb/index-6--6287796740362363623.wt
    mongodb/index-4--2162478702715552952.wt
    mongodb/collection-2--6287796740362363623.wt
    mongodb/index-3--6287796740362363623.wt
    mongodb/index-1--2162478702715552952.wt
    mongodb/index-1--4216008088303394775.wt
    mongodb/collection-0--4216008088303394775.wt
    mongodb/mongod.lock
    mongodb/WiredTiger
    mongodb/collection-0--6287796740362363623.wt
    mongodb/index-4--4216008088303394775.wt
    mongodb/storage.bson
    mongodb/sizeStorer.wt
    mongodb/index-2--2162478702715552952.wt
    mongodb/index-3--4216008088303394775.wt
    mongodb/index-1--6287796740362363623.wt
    mongodb/index-5--6287796740362363623.wt
    
    

    有没有熟悉 mogodb 的大佬看一眼,这究竟是啥备份数据呀,怎么恢复呀,我用 MongoDB 自带的导入命令尝试,始终说格式不对。我从最新的 7.0.4 版本,一路试到 3.0 版本,全部说格式不对。难不成这个是什么第三方工具导出的数据?

    killva4624
        1
    killva4624  
       2023-11-28 17:33:54 +08:00
    这个是冷备文件,不是逻辑文件吧...你应该用这个冷备文件去直接启动一个 mongod

    https://www.mongodb.com/docs/manual/tutorial/manage-mongodb-processes/#specify-a-data-directory
    sadfQED2
        2
    sadfQED2  
    OP
       2023-11-28 17:44:43 +08:00 via Android
    @killva4624 哦,我靠,脑子短路了,没想到。感谢大佬,给大佬磕头
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2765 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 18ms · UTC 14:28 · PVG 22:28 · LAX 06:28 · JFK 09:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.