This guide shows you how to migrate from OpenVZ to VMware.
VMware is based on a different type of virtualization compared to OpenVZ, which means that it is not possible to convert a VPS automatically from OpenVZ to VMware. Therefore, you need to transfer the files to the new VMware server manually.
It is important to note that you cannot use the same IP address on the new VMware server. Some legacy applications have hard-coded IP address dependencies and this need to be addressed. Users and passwords, on the other hand, will be moved along.
To complete this guide, technical knowledge is required. If you need help migrating, contact us at support@glesys.se for a consultation and a quote.
Upgrade both of your servers with the latest packages and install rsync as the tool for synchronizing files and libraries between your servers.
apt-get update && apt-get install rsync && apt-get dist-upgrade -y
reboot
Log in as root on your OpenVZ server from where we’ll run rsync. Before proceeding, keep in mind that you need to shut down all applications and services that write to disk, for example: Apache, MariaDB and MySQL. Also make sure to pause any cronjobs running.
Note! Replace $IP
below with the IP address of the target server (KVM) when you’re running the rsync syntax to copy the files:
rsync -avz --numeric-ids --delete --exclude /run --exclude /lib/udev --exclude /etc/udev --exclude /lib/modules/ --exclude /aquota.group --exclude /aquota.user --exclude /boot/ --exclude /dev/ --exclude /proc/ --exclude /etc/network/interfaces --exclude /sys/ --exclude /etc/fstab / $IP:/
Now the new server has all the data it needs from the OpenVZ server. However, the Debian or Ubuntu package database is also synchronized which is a problem. To fix it we need to reinstall grub.
Log in as root user and run:
apt-get install linux-image-amd64 linux-headers-amd64 busybox grub-pc acpid acpi-support-base open-vm-tools
apt-get install linux-image-generic linux-headers-generic busybox grub-pc acpid acpi-support open-vm-tools
You will be asked where to install the boot loader. Choose /dev/sda
.
GRUB install devices:
[*] /dev/sda (21474 MB; ???)
Enable the console (if it’s not already):
systemctl enable getty@tty1.service
Reboot the server:
reboot
Now you are able to log in to the new server (VMware) with the same credentials as you used on the old server (OpenVZ). Keep in mind that you have a new IP address.
If you have been using DNS or a load balancer for the OpenVZ server it is now time to redirect it to the VMware server.
It’s not recommended to permit root login with password over SSH. We recommend to disable the possibility to log in with password in the SSHd server and only allow SSH keys.
Note! Make sure you can log in with your SSH key before taking this action.
sudo sed -i 's/^PermitRootLogin yes/PermitRootLogin prohibit-password/g' /etc/ssh/sshd_config
sudo systemctl restart sshd
If you don't wish to keep your OpenVZ server after migration, you have to delete it in the control panel after shutdown – otherwise you will still be billed for it.
If you need help migrating, contact us at support@glesys.se for a consultation and a quote.
Kontakta oss gärna för mer information. Vi hjälper dig att komma fram till den bästa lösningen för dina behov.