Reputation: 271
I have a QuestDB container that's running an older version at the moment, it's started and stopped by --name
so that the data is persisted:
docker run --name old_questdb \
-p 9000:9000 -p 9009:9009 questdb/questdb:5.0.5.4-linux-amd64
Is there any way to mount the volume or get the persisted data from this named container into a new instance with the latest version? I would like to run 6.0.4
Upvotes: 2
Views: 290
Reputation: 1315
You can copy the contents of a container to a local directory and then mount it back to a new one:
# 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
Upvotes: 2