I run a Minecraft Bedrock server in a Docker container (image itzg/minecraft-bedrock-server).
I pulled a newer version of the image, but the container keeps using the old one. The manuals I found on the Internet say that I have to create a new container with the new image. If I remove the old container, I lose my configuration and worlds. I know how to copy files from my container, but I don't know how to copy them **safely** to the new container. I suppose the Minecraft sever should be stopped before copying, but when I stop the server the container automatically shuts down.

What is the right way to get my Minecraft server updated?

Environment: a Linux distro runnig on NAS QNAP TS-664. I use Container Station as GUI for docker, and I have SSH access to the device.