Migrating Nextcloud AIO Docker Server from ext4 to xfs

Complete Guide for Migrating a VM in Proxmox to a New VM Optimized for Nextcloud AIO

This guide covers the following steps:

  1. Backing up existing data from the original server.

    • 1.1 Rocket.Chat Docker
    • 1.2 Home directory home/tony - only selected folders
    • 1.3 Directory containing all Docker volumes running on the server, including the original Nextcloud AIO.
  2. Creating a VM in Proxmox (NVMe disk + Ballooning)

  3. Installing Ubuntu Server on XFS file system

  4. Reverse synchronization (local location → server)

    • 4.1 Reverse synchronization for Rocket.Chat
    • 4.2 Reverse synchronization for home-tony
    • 4.3 Reverse synchronization for docker-folders

Migrating a Proxmox VM to a New VM

Note: The local disk where the data will be synchronized must not be NTFS but a Linux file system. In this guide, the disk is formatted as XFS. NTFS would not allow correct preservation of permissions, owners, and extended attributes, which are essential for seamless synchronization and subsequent migration to the new VM.

1. Synchronization (server → local location)

1.1 Synchronizing Rocket.Chat

  • Source path (server): /opt

  • Local path: /mnt/xfs4tera/tony/backup/rocket-chat

  • Command:

    sudo mkdir -p /mnt/xfs4tera/tony/backup/rocket-chat
    sudo rsync -ahPz -o -g -A -X --numeric-ids --bwlimit=97280 root@192.168.1.139:/opt/ /mnt/xfs4tera/tony/backup/rocket-chat/
    

1.2 Synchronizing Home Directory (home-tony)

  • Source path (server): /home/tony/

  • Local path: /mnt/xfs4tera/tony/backup/home-tony

  • Include file (list of folders to sync, excluding others):

    Correct content of include-list-2.txt:

    jellyfin/***
    linux_desktop_kurz/***
    Media-files/***
    navidrome/***
    plex/***
    plex_transcoding/***
    portainer/***
    portainer_agent/***
    rocketchat/***
    slavia-aio/***
    snap/***
    tautulli/***
    temp-upload/***
    watchtower/***
    apache-logs/***
    

    Command to create include-list-2.txt:

    nano include-list-2.txt
    

    Then, paste the content above and save the file.

  • Command:

    sudo mkdir -p /mnt/xfs4tera/tony/backup/home-tony
    sudo rsync -ahPz -o -g -A -X --numeric-ids --bwlimit=97280 --include-from='include-list-2.txt' --exclude="*" root@192.168.1.139:/home/tony/ /mnt/xfs4tera/tony/backup/home-tony/
    

1.3 Synchronizing Docker Volumes

  • Source path (server): /var/lib/docker/volumes

  • Local path: /mnt/xfs4tera/tony/backup/docker-folders

  • Command:

    sudo mkdir -p /mnt/xfs4tera/tony/backup/docker-folders
    sudo rsync -ahPz -o -g -A -X --numeric-ids --bwlimit=97280 --exclude='backingFsBlockDev' --exclude='metadata.db' root@192.168.1.139:/var/lib/docker/volumes/ /mnt/xfs4tera/tony/backup/docker-folders/
    

2. Creating a VM in Proxmox (NVMe disk + Ballooning)

Step 1: Creating the VM

  1. Name: Ubuntu24-Server
  2. CPU: 12 vCPU (cores), CPU type: host
  3. RAM: 16 GB RAM (set to 16384 MB in Proxmox)
  4. Disk: 2 TB (set to 2048 GiB in Proxmox)
    • Disk type: VirtIO SCSI single
    • Cache: Writeback
    • Discard: Enabled
    • IO Thread: Enabled
  5. Network adapter: VirtIO, connected via Bridge Mode (e.g., vmbr0).
  6. BIOS: Leave as default (not UEFI).

Step 2: Enabling Ballooning

  1. Open Hardware for the VM in Proxmox.
  2. Click Memory and enable Ballooning.
  3. Set Ballooning to a minimum of 8192 MB.

3. Installing Ubuntu Server on XFS

Step 1: Installing the Base System

  1. Create the installation media and start installing Ubuntu Server 24.04.
  2. File System Selection: Choose XFS for the 2 TB disk.
  3. Swap Setting: Set 8 GB SWAP during installation.
  4. Install the essential packages, including OpenSSH Server, to enable SSH access to the system.

Step 2: Installing Basic Tools

After installation, log into the system and install the following packages:

sudo apt update && sudo apt upgrade -y
sudo apt install qemu-guest-agent chrony btop tzdata ufw -y

4. Reverse Synchronization (local location → server)

4.1 Reverse Synchronizing Rocket.Chat

  • Local path: /mnt/xfs4tera/tony/backup/rocket-chat/

  • Destination path (server): /opt/

  • Command:

    sudo rsync -ahPz -o -g -A -X --numeric-ids --exclude='containerd' /mnt/xfs4tera/tony/backup/rocket-chat/ root@192.168.1.139:/opt/
    

4.2 Reverse Synchronizing Home-Tony

  • Local path: /mnt/xfs4tera/tony/backup/home-tony/

  • Destination path (server): /home/tony/

  • Command (with temporary exclusion of the Media-files folder):

    1. Comment out Media-files in include-list-2.txt:

      # Media-files/***
      
    2. Use this command:

      sudo rsync -ahPz -o -g -A -X --numeric-ids --bwlimit=97280 --include-from='include-list-2.txt' --exclude="*" /mnt/xfs4tera/tony/backup/home-tony/ root@192.168.1.139:/home/tony/
      

4.3 Reverse Synchronizing Docker Folders

  • Local path: /mnt/xfs4tera/tony/backup/docker-folders/

  • Destination path (server): /var/lib/docker/volumes/

  • Command:

    sudo rsync -ahPz -o -g -A -X --numeric-ids --exclude='backingFsBlockDev' --exclude='metadata.db' /mnt/xfs4tera/tony/backup/docker-folders/ root@192.168.1.139:/var/lib/docker/volumes/