Kyysel
Kyysel

Reputation: 66

Docker Desktop: Move container/image WITH volume/data

Got a running setup in docker desktop on windows with Mysql, zabbix server, nginx, javagateway which runs on zabbix subnet and monitors an agent on a remote desktop. wsl2 and ubuntu also installed.

I need to move the containers with volumes to a new host and have great problems doing so.

So far I've tried export/save in to tar, load/import from tar, tag, cp the folders of the containers, all without success.

No matter what I do the data does not follow to the new host. I then tried to open the config.v2.json file inside the containers and replace all settings with the settings from the working host, also without success.

So basically I'm stuck at square one, only that now I have all the folders from the working/running containers on the current host, but no idea how to make use of them.

Also inside those folders the docker folder is not visible, /var/bin/docker.

On the current host I added a container that can access the docker folder and thats how I got my hands on the running containers.

I've read zabbix docs, docker docs but I still cant figure it out.

I've never worked with docker before, any help and ideas are appreciated, don't hesitate to ask for clarifications.

TLDR: Goal is to move an entire container (with volume) to a new host so it can run just how it did on the previous machine.

Upvotes: 1

Views: 1658

Answers (1)

Kyysel
Kyysel

Reputation: 66

Solved, after an eternity of searching I found this thread: Locating data volumes in Docker Desktop (Windows) this combined with exporting and importing the containers solved my issue.

Simply:

  1. export and import the containers between the old and new host.
  2. check the link above
  3. move the _data into the new volumes on the new host (do not replace the folders with unique ID's, just _data inside).

Upvotes: 0

Related Questions