xenA: Your previous server
xenB: Your new server
Step1: Boot both server with a live linux dist(Ubuntu,Fedaora, CentOS)
Step2: Start ssh service in your new server
Step3: In xenA execute the command below
dd if=/dev/sdX bs=16M | pv | ssh user@xenB dd of=/dev/sdX
Where X represents the local disks attached to the servers.
You can find them wiht "lsblk" command.
Note: pv is used for monitorng the data.
Step4: Modify the IP adress and all the other parameters which are changed.
With this method you do not need to worry about partitions, lvm volumes and the filesystem above.
Hope that this method address your question.
1. Step: Boot the
Boot in to single mode by changing boot parameter: "vga=785 splash" with linux single. You can find the screenshots from the link below.
https://support.citrix.com/article/CTX116019#Resetting%20Password%20in%20XenServer%20Versions%205.0%20and%20Later
- Step: Start the network service on your host with single user mode and transfer the exact block device to another machine.
dd if=/dev/sda bs=16M | ssh user@backuphost dd of=backup.img
You can find detailed info in terms of compression below:
Well there are multiple methods to achive this goal.
- dd and netcat WARNING: This method expose your data on internet trading the time consumption.
If you are able to boot the system with single user or another live image you can use the dd method for the exact copy of your server,it is mandatory to stop all services and vms in order to ensure data integrity:
- Prepare a backup host by executing the command below, (use screen or tmux or make the command to fork background if you are working with a remote backup host to avoid ssh timeouts)
nc -l RANDOMPORTNUMBER|bzip2 -d|dd bs=16M of=backup.img
- On your vm host you can execute the command below in order clone your exact host
dd bs=16M if=/dev/sda|bzip2 -c|nc ipaddressofbackuphost RANDOMPORTNUMBER
- tar and ssh I personally prefer this method to to back up my remote machines when needed. This method does not directly expose your data to public network since it uses ssh.
One another reason that i prefer this method is since the backup will be done in file level, the empty spaces and block devices which are not needed to be backed up are excluded,where we save storage and traffic. Since you declared that you want an exact clone I had to talk about the first method.
Please do not forget to modify the excluded mount points according to your distribution and the application. You have to consider that if you are charged by your storage and traffic amount.
cd / # THIS CD IS IMPORTANT THE FOLLOWING LONG COMMAND IS RUN FROM /
tar -cvpzf backup.tar.gz \
--exclude=/backup.tar.gz \
--exclude=/proc \
--exclude=/tmp \
--exclude=/mnt \
--exclude=/dev \
--exclude=/sys \
--exclude=/run \
--exclude=/media \
--exclude=/var/log \
--exclude=/var/cache/apt/archives \
--exclude=/usr/src/linux-headers* \
--exclude=/home/*/.gvfs \
--exclude=/home/*/.cache \
--exclude=/home/*/.local/share/Trash / | ssh <backuphost> "( cat > ssh_backup.tar.gz )"
Here you can find further detailed information about the topic: