Proxmox VM Migration Tutorial
Updated On: Nov. 26, 2024 Author: Kevin

Proxmox VM Migration Tutorial

Migrating your VMs to a new Proxmox instance is a straightforward process if you follow the correct steps. This guide will walk you through backing up your VMs, installing the new Proxmox environment, and restoring your VMs efficiently. Let’s get started!

Step 1: Backup VMs to a USB Disk

  1. Connect the USB Disk to Your Proxmox Server:

    lsblk
    mkdir /mnt/usb
    mount /dev/sdX1 /mnt/usb

    Replace /dev/sdX1 with the actual device name of your USB disk.

  2. Backup Each VM:

    vzdump <vmid> --dumpdir /mnt/usb

    This will create a .tar.lzo or .tar.zst file for each VM.

  3. Verify Backups:

    ls /mnt/usb
  4. Unmount the USB Disk:

    umount /mnt/usb

Step 2: Install the New Proxmox

  1. Prepare for Installation:
    • Download the latest Proxmox ISO from the Proxmox website.
    • Create a bootable USB stick using tools like Rufus (Windows) or dd (Linux):

      dd if=proxmox-ve.iso of=/dev/sdX bs=4M status=progress
  2. Install Proxmox:
    • Boot from the Proxmox ISO and follow the installation prompts.
    • Overwrite the existing Proxmox installation.
    • Configure the new Proxmox instance as needed (network, storage, etc.).

Step 3: Restore VMs from USB Disk

  1. Reconnect the USB Disk:

    mount /dev/sdX1 /mnt/usb
  2. Transfer Backups (Optional):

    cp /mnt/usb/*.tar.lzo /var/lib/vz/dump/
  3. Restore Each VM:

    qmrestore /mnt/usb/<backup-file>.tar.lzo <vmid> --storage <storage-name>
  4. Verify and Start VMs:
    • Check the VM configuration:

      qm config <vmid>
    • Start the VM:

      qm start <vmid>

Post-Migration Tasks

  • Test VMs: Ensure all applications and services inside the VMs are running correctly.
  • Reconfigure Network: Update network settings to match the new Proxmox environment.
  • Unmount the USB Disk:

    umount /mnt/usb
  • Set Up Backups: Configure regular backups on the new Proxmox instance to prevent future data loss.
  • Update Proxmox and VM Tools:
    • Update Proxmox:

      apt update && apt dist-upgrade -y
    • Install QEMU Guest Agent on VMs:

      apt install qemu-guest-agent

By following this guide, you can successfully migrate your VMs to a new Proxmox installation while maintaining data integrity and minimizing downtime.