0

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.

Kyysel
  • 56
  • 1
  • 7
  • Usually the procedure is to transfer the data (just `scp` it if it's entirely in bind-mounted host directories, [more complicated for named volumes](https://docs.docker.com/storage/volumes/#backup-restore-or-migrate-data-volumes)) and then recreate the containers on the new system (maybe transferring the `docker-compose.yml` file, if that's how you started things). You don't need to migrate the containers, just create new ones. – David Maze Jul 19 '22 at 10:19
  • `So far I've tried export/save in to tar, load/import from tar,` Great. Did you do the same for all volumes? – KamilCuk Jul 19 '22 at 10:25
  • Don't think any of my containers are mounted (atleast I havn't done anything extra to mount them). Also I havn't used docker-compose.yml maybe I should look into that @ David Maze. Oh jeeze... I didnt think of that the volumes also could be tar'd. But save/export "throws all data away", doesn't it? It just brings lower layers of the container? @ KamilCuk – Kyysel Jul 19 '22 at 10:31

1 Answers1

0

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).
Kyysel
  • 56
  • 1
  • 7