Hello everyone,
I’ve been running a self-hosted Nextcloud AIO Docker server on my home Proxmox server for the past 2 years. Aside from the issue I reported here: Nextcloud VM crashes when syncing large files, everything has been running quite smoothly.
Current Setup:
- OS: Ubuntu Server 24.04
- Filesystem: ext4
- Nextcloud version: Nextcloud AIO - v29.0.7
- Hosting: Self-hosted on Proxmox
Problem:
- I’m experiencing issues when syncing large files, which may be related to the use of the
ext4
filesystem.
- To resolve this, I am considering reinstalling Ubuntu and switching the filesystem from
ext4
to xfs
for better large file handling.
My Goal:
- Migrate the existing Nextcloud AIO setup from
ext4
to xfs
without needing to reinstall Nextcloud or recreate users, settings, and configurations.
- Ideally, I want to back up the necessary Docker folders and restore them on the new server.
What I Need Help With:
- Which folders do I need to back up?
- I assume the critical data is located in
/var/lib/docker/volumes
, but I need confirmation.
- How can I retain permissions and configurations during the migration process?
- Is there a recommended approach for this migration to ensure a smooth transition?
Any advice on how to proceed or best practices for this type of migration would be greatly appreciated!
Complete Guide for Migrating a VM in Proxmox to a New VM Optimized for Nextcloud AIO
This guide covers the following steps:
-
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.
-
Creating a VM in Proxmox (NVMe disk + Ballooning)
-
Installing Ubuntu Server on XFS file system
-
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
- Name: Ubuntu24-Server
- CPU: 12 vCPU (cores), CPU type: host
- RAM: 16 GB RAM (set to 16384 MB in Proxmox)
- Disk: 2 TB (set to 2048 GiB in Proxmox)
- Disk type: VirtIO SCSI single
- Cache: Writeback
- Discard: Enabled
- IO Thread: Enabled
- Network adapter: VirtIO, connected via Bridge Mode (e.g., vmbr0).
- BIOS: Leave as default (not UEFI).
Step 2: Enabling Ballooning
- Open Hardware for the VM in Proxmox.
- Click Memory and enable Ballooning.
- Set Ballooning to a minimum of 8192 MB.
3. Installing Ubuntu Server on XFS
Step 1: Installing the Base System
- Create the installation media and start installing Ubuntu Server 24.04.
- File System Selection: Choose XFS for the 2 TB disk.
- Swap Setting: Set 8 GB SWAP during installation.
- 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):
-
Comment out Media-files in include-list-2.txt:
# Media-files/***
-
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/