首页 > 解决方案 > 如何在不丢失容器数据的情况下更新 QuestDB docker 版本?

问题描述

我有一个 QuestDB 容器,它目前正在运行旧版本,它的启动和停止是--name为了保持数据:

docker run --name old_questdb \
-p 9000:9000 -p 9009:9009 questdb/questdb:5.0.5.4-linux-amd64

有什么方法可以挂载卷或从这个命名容器中获取持久数据到具有最新版本的新实例中?我想跑步6.0.4

标签: questdb

解决方案


您可以将容器的内容复制到本地目录,然后将其挂载回新目录:

# copy the contents of the old_questdb container to the current dir
docker cp old_questdb:/root/.questdb $(pwd)

# run 6.0.4 and mount to the current dir
docker run --name new_questdb \
-v "$(pwd)/.questdb:/root/.questdb/" \
-p 9000:9000 -p 9009:9009 questdb/questdb:6.0.4

推荐阅读