2 min read

Migrating Proxmox Containers to a New Machine

I recently picked up a Lenovo ThinkBook M series and installed Proxmox on it. Since I was already running Proxmox on a MacBook Air, I wanted to migrate all my existing containers to the new machine. The process turned out to be surprisingly simple, and here’s a step-by-step guide based on how I did it.


Step 1: Back Up Containers on the Source Machine

The first step was to create backups of each container on the source Proxmox machine (my MacBook Air). Proxmox automatically stores these backups in the following directory:

/var/lib/vz/dump/

You can trigger the backups via the Proxmox web interface by selecting each container and choosing the "Backup" option.

Tip: It’s a good idea to regularly back up your containers and store the backups on a remote drive or another machine. While you can set up a dedicated Proxmox Backup Server, I find that using simple image backups works just as well, as long as you stick to a consistent backup routine.

Note: If you're looking to also back up and restore your Proxmox host, this thread could be helpful. There may be custom configurations that can streamline the restoration process.


Step 2: Transfer the Backup Files to the New Proxmox Machine

After backing up the containers, I transferred the backup files to the new Proxmox machine. While SSH'd into the source machine, I used scp to copy the files over:

scp -r /var/lib/vz/dump/* root@[targetIP]:/var/lib/vz/dump/

Make sure to replace [targetIP] with the IP address of your new Proxmox machine.

This command recursively copies all backup files from the source machine to the new one. Using scp worked great for me, but you can also use other tools like rsync if you prefer incremental transfers.


Step 3: Restore Containers on the New Machine

Once the backup files were on the new machine, I opened the Proxmox web interface, navigated to the "Backup" section, and selected "Restore" for each container image. The restore process went smoothly, and within minutes, all my containers were up and running on the new system.


Final Thoughts

Migrating Proxmox containers to a new machine was much easier than I expected. By simply backing up, transferring, and restoring container images, I was able to replicate my entire setup without any headaches.

While Proxmox Backup Server is a great option for centralized and automated backups, this simple image-based method works perfectly for me. The key is to back up regularly and store those images on another machine or an external drive to safeguard against hardware failures.

If you’re thinking about upgrading your Proxmox hardware or just want to be prepared for emergencies, this approach is a straightforward and reliable solution.