I am one of those people who function better by writing things down. One day, I realized that most of my notes don’t have to be private, so here they are - my second brain. Be warned that, if you stumble upon something here that doesn’t make sense to you, it isn’t meant to!
Migrate Docker data across VMs
I had a large Docker Compose project on a Proxmox LXC and I recently decided to migrate that to a new VM. So, in addition to code, I had to create an exact copy of my Docker volume and non-volume data. Here’s how I did that. First, a few things to note: I used the destination VM to trigger the rsync command. I used sudo on both sides because the files were owned by multiple arbitrary users. (This complicated things a bit.) I had to do the following in order. (Earlier, I didn’t docker compose create and ran into this error.) rsync the Docker Compose code. docker compose create on the destination. rsync Docker volume data. (I did this twice actually: once, while the project was up on the source and once after bringing it down. This helped me decrease overall downtime.) docker compose up -d or whatever on the destination. Second, I used something like the following to create exact copies: ...