Server Migration

Linux Server Migration

Introduction

We were running our domains at a vServer of Vollmar.net, a very reliable hoster. They decided to change their virtualization environment from CTX to XEN – which is fine. The drawback: There is no automatical „migration“ for the images. Since I would like to have a XEN-based server due to more power for the same money, we need to reinstall our vServer.

So, this is about how to migrate a Linux system from one server to another. Of course, this is limited to the software I run on the vServer. Also pathes might be Debian specific.

Before we start…

For transfering data from the old to the new server I use ssh this way:

cd DIR && tar -cf - . | ssh newServerIP "cd DIR && tar -xpvf -"

This has the benfit of preserving the permission and ownership of the files.

Testing of most applications is quite easy by putting the new IP adresse into /etc/hosts on a local machine. This uses the server prior to the changes within the DNS.

Installing the same software

On the old server we retrieve the package list:

dpkg --get-selections > PKGLIST

We transfer this PKGLIST to the new server and:

dpkg --set-selections < PKGLIST

Finally we tell apt-get to install the packages:

apt-get dselect-upgrade

If we have installed apt-file, we need to retrieve its filelists:

apt-file update

Depeding on package selection, this is now a very unsecure situation: Services are up and running, but are unconfigured! Thus we shut them down. For me these are: