Hetzner - DokuWiki

How to migrate vServers to Cloud/en
K (openSUSE)
Zeile 153: Zeile 153:
$ exit</pre>
$ exit</pre>
==== openSUSE ====
==== openSUSE ====
<pre>$ chroot-prepare /mnt&nbsp;; chroot /mnt
<pre>$ chroot-prepare /mnt ; chroot /mnt
<pre>$ grub2-install /dev/sda
<pre>$ grub2-mkconfig -o /boot/grub2/grub.cfg
<pre>$ mkinitrd
<pre>$ exit
== <span class="mw-headline" id="Letzte_Schritte_beim_Cloud_Server"><span class="mw-headline" id="Letzte_Schritte_beim_Cloud_Server">last steps at the Cloud Server</span></span> ==
== <span class="mw-headline" id="Letzte_Schritte_beim_Cloud_Server"><span class="mw-headline" id="Letzte_Schritte_beim_Cloud_Server">last steps at the Cloud Server</span></span> ==

Version vom 11. Juni 2018, 17:05 Uhr


Migration from vServer to Cloud

You may migrate existing VQ/VX/CX vServer to the current Cloud Server

steps of migration:

  1. creating of similar or more powerful cloud server
  2. start the rescue system on the both servers and mount filesystem
  3. trigger the synchronization with rsync

important information

The following operation systems are not supported.

  • Debian 6 and older
  • Ubuntu 11.10 and older
  • CentOS 5.6 and older
  • OpenSuse 11.4 and older

For the listed operation systems is an upgrade to newer version necessary.

activate the rescue system

To transfer the data, you will boot the server into the rescue system. You may activate the rescue via robot and cloud panel.

mount of the filesystem

After the start of the rescue system, you will mount the filesystem to copy files.

On the VQ/VX/CX vServer are set up a different controller. Please check the partitions via:

$ fdisk -l

You may mount the filesystem via.

$ mount /dev/XXXY /mnt

Please substitute XXX with the device declaration and Y with the partition number.

Mounting of swap partition :

$ swapon /dev/XXXY

If exists a boot partition, so mount the main partition at first and in the end the boot partition.

The mountpoint for the boot partition is /mnt/boot.

You will mount the filesystem of the cloud server later.

Change to DHCP


edit of  /mnt/etc/network/interfaces

Remove lines like z.B. auto ens3, iface ens3 inet static .

auto eth0
iface eth0 inet dhcp
iface eth0 inet6 static
    netmask 64
    gateway fe80::1

Remove further lines  likes address, netmask and gateway in the IPv4 part (iface eth0 inet dhcp) .

CentOS und openSUSE

rm /mnt/etc/sysconfig/network-scripts/route-eth0

edit of  /mnt/etc/sysconfig/network-scripts/ifcfg-eth0



Arch Linux

If the installation of ArchLinux performed with our ISO or installimage, so will used systemd-network.

Edit of /mnt/etc/systemd/network/network/10-ens3.network (In some cases 10-eth0.network too!)


Remove lines like address and Gateway.

Removing the udev-rule of the network interface card

Every virtual server has a unique MAC, please remove the current udev-rule in preparation of the migration.

rm /mnt/etc/udev/rules.d/70-persistent-net.rules
rm /mnt/etc/udev/rules.d/80-net-setup-link.rules

Arch Linux

Create a link with /dev/null. For that reason the NIC is called eth0 again.

$ ln -s /dev/null /etc/systemd/network/99-default.link

Migration to Cloud Server

delete the drive

As first step please delete drives of the cloud server.

$ mkfs.ext4 /dev/sda1

mount the filesystem on the cloud server

$ mount /dev/sda1 /mnt


The data transfer will be performed with rsync

$ rsync -avz --progress IP-old-server:/mnt/* /mnt

Adjustment of fstab on the cloud server. This is procedure is necessary, otherwise the server is not able to boot up.

Read out the UUID of the partitions.

$ blkid -o value -s UUID /dev/sda1

Example /mnt/etc/fstab with UUID before

UUID=bad16011-8988-4c53-ba5c-6727f8b90001 / ext3 defaults 0 0

adjust to

UUID=bad16011-8988-4c53-ba5c-6727f8b90001 / ext4 discard,errors=remount-ro 0 1


The bootloader has still the old configuration. Now update the configuration via the following commands.


$ chroot-prepare /mnt ; chroot /mnt
$ grub-mkdevicemap
$ grub-install /dev/sda
$ update-initramfs -u
$ update-grub
$ exit

CentOS 6

$ chroot-prepare /mnt ; chroot /mnt
$ grub-install /dev/sda

Please adjust the UUID in /boot/grub/grub.cfg on your own, because the bootloader will be not updated via grub-install.

After the adjustment of /boot/grub/grub.cfg, perform the following commands.

$ dracut -f
$ exit

CentOS 7

$ chroot-prepare /mnt ; chroot /mnt
$ grub2-install /dev/sda $ grub2-mkconfig -o /boot/grub2/grub.cfg
$ dracut -f
$ exit

Arch Linux

$ chroot-prepare /mnt ; chroot /mnt
$ grub-install /dev/sda
$ grub-mkconfig -o /boot/grub/grub.cfg
$ mkinitcpio -p linux
$ exit


$ chroot-prepare /mnt ; chroot /mnt
<pre>$ grub2-install /dev/sda
<pre>$ grub2-mkconfig -o /boot/grub2/grub.cfg
<pre>$ mkinitrd
<pre>$ exit

last steps at the Cloud Server

To use the cloud server again, please umount the filesystem

unmount the filesystem

$ umount -R /mnt

restart the server

$ reboot

© 2020. Hetzner Online GmbH. Alle Rechte vorbehalten.