Physical Server Migration

Walery

Active Member
Feb 11, 2021
73
1
28
43
Hello. I have a question and I don't know how to solve it. I need help.
I have an old centos 5 mail server (it runs constantly) on a physical server.
I want to transfer the system to a virtual machine on Proxmox.
I need to do this either "live" or with minimal downtime.
The disk used in the server is 1 Tb and it is 99% busy

If you use clonezilla, then creating an image takes 4-5 hours. This is a lot for server downtime.
Maybe there are some options for creating a disk image "on the fly" without interrupting the server, and then synchronizing to update the data?
 
This isnt really a pve question. Also, I would strongly advise taking this opportunity to migrate your mail server to a currently supportable environment- mail is one of the most obvious places for external attack after all.

Luckily for you, both can be achieved at the same time. Below is the steps in broad strokes- search the internet for a more specific howto:
1. stand up a new server and postfix.
2. add an mx record for the new server as a secondary mail server.
3. set the new server as the email relay for outbound traffic for the original server
4. rsync the mail data from old server to the new
5. disable the original and remove its mx record.
 
setup the system in proxmox (or at least create the disk layout and networks you need)

boot the system in a rescue system (e.g. we use mostly grml).

bring up networking in rescue system and start sshd with passwd login for root

mount your disk(s) under /target (evtl create fs if you didnt do it already)

now rsync the old running system on the fly to new system /target

you can do this several times. use --numeric-ids and exclude certain dirs like /proc /sys and so on

before last sync, stop all services in old server.
sync, stop services, sync again.
shutdown old server or disconnect.

the last sync is very short then.

chroot into new server /target and reinstall grub etc

reboot new server. the new server is then in the exact state of the old server.

there are several pitfalls, you should know what you do and maybe train this steps somewhere.

we migrated hundreds of servers without relevant downtime this way over the years (e.g. whole infrastructure from xen to kvm)

BUT: you should upgrade anyway :), so setup a new fresh system and just migrate user data