Comment on Portainer 3.0 is coming, and here's what it means for you — Portainer

<- View Parent
Zectivi@piefed.social ⁨9⁩ ⁨hours⁩ ago

I just finished the migration to Dockhand. I never had to stop a single container.

I copied out all the docker compose files portainer stored for the stacks:

sudo rsync -a /var/lib/docker/volumes/portainer_data/_data/compose/ ~/stacks-backup/

The bonus of doing it this way is permissions, and it also nabs the .env files if you’ve configured vars in the Stacks config (and not directly in the compose file)

Because all the folders were just ID’s, I renamed them:

docker ps -a --format '{{.Label "com.docker.compose.project.working_dir"}}\t{{.Label "com.docker.compose.project"}}' | sort -u | while IFS=$'\t' read -r wd name; do id="${wd##*/}"; [ -n "$id" ] && [ -d ~/stacks-backup/"$id" ] && mv ~/stacks-backup/"$id" ~/stacks-backup/"$name"; done

After that, I ran du -sh against both directories to ensure they match.

Once the rename was done, I settled on moving all my stack configs to /opt/stacks, and added a folder for the compose file for dockhand, because dockhand can manage itself, unlike Portainer. Additionally, I made sure the /opt/stacks folder I moved those files to was mounted by Dockhand in the compose file.

docker compose up -d in the dockhand dir, and then went to the UI.

Configure the env how you want, and have it point at whatever your config was. I am running everything in Ubuntu server, so I just left the default Unix stuff set.

From there, the Stacks UI in Dockhand listed everything, but it knew nothing really about them. Pick a low-impact stack, and open it. You should see a section on the left where you can browse to /opt/stacks, for example, and if you’ve renamed the folders, easily find the yaml. Once loaded, you should see the config on the left. On the right is where you can add your env vars. If you have a .env that moved over, there’s a folder icon at the top you can use to navigate to it and pick it.

I have 18 stacks. Start to finish was approx 1 hour. I have 14 volumes, and those are all present, including the association to the stack they belong to, and everything matches what I see in Portainer, which is still up and running alongside Dockhand.

I hope this all helps you. Realistically, I don’t know if you’ll have an issue with volumes. All mine are managed via docker itself and not portainer, so there was nothing I needed to do there.

original
Sort:hotnewtop