美文网首页
dump and restore from docker

dump and restore from docker

作者: tyoko | 来源:发表于2019-05-14 16:25 被阅读0次
    docker run --rm --link <local machine docker container name>:mongo [--network accountpool-net] -v <local machine directory>:/backup mongo bash -c 'mongodump --out /backup --host mongo:27017 --username <username> --password <password> -d <db name>'
    
    
    docker run --rm --link <local machine docker container name>:mongo  -v <local machine directory>:/backup mongo bash -c 'mongorestore /backup --host mongo:27017 --username <username> --password <password>'
    

    example:
    local machine directory: /home/ubuntu/accountPool_bak/2019-04-19

    相关文章

      网友评论

          本文标题:dump and restore from docker

          本文链接:https://www.haomeiwen.com/subject/ifqeaqtx.html