Currently, I have Debian installed on a desktop computer with an Intel P4. It is a web server. As my website starts to be more and more popular, I want to migrate to a real server.
So I bought a new server (IBM eSeries 235) and I want to migrate the whole debian system into the new server.
The new server has 2 CPUs (sockets) instead of 1 in the old server. Can this cause issues?
I would just backup the whole old system using tar and then install Debian 6.0.3 on the new server, and then untar the backup onto the freshly installed OS on the new server. Is this a good way to migrate? If not, what should I do.
In terms of hardware compatibility, if your server does not require proprietary drivers you should be fine. New CPU cores will be detected. One way to find out is to run Debian LiveCD on your server and see what is detected and what is not. With regards to migration you have few options :
- Set up your new server from scratch.
This would probably be most time consuming but a good way to revise your setup for a new environment e.g remove unnecessary packages ( GUI or other desktop packages etc.. ), harden security.
- RSYNC / Copy
Cumbersome but will require least downtime if you need to have you existing server up and running and don't want to set up from scratch.
replicate partition layout to mirror your existing system
sfdisk -d /dev/sda | sfdisk /dev/sdb
sda is your exisitng server sdb is your new server
create filesystem / swap on your new drive partitions and mount root, boot and any other partitions from your new drive on your existing system.
copy contents of your existing system to the new drive
/mnt/NEW is the mountpoint of root (/) from the new drive.
repeat for /boot and other partitions if there are any
Setup grub on your new drive.
Run 'grub' and :
You might have to modify grub menu.cfg file to update root partition if LABEL is used.
Commands will vary depending on your partitions layout or if you have raid/LVM etc.. This should leave you with a ready to boot system. If there were changes on your current system while you were doing rsync and you want them to appear on your new system, shut down your system with both drives (current and new ) plugged in and boot into Live CD (SystemRescueCD is great), mount root partitions from both and re-run rsync commands. This should only copy the difference and take little time. Make sure you are copying in the right direction old->new drive.
- DD / Clone
Best option in terms of perfect and easiest migration. This will leave you with an identical copy of you existing system but will require downtime.
Boot your PC with both drives plugged into Live CD (SystemRescueCD is great) and run DD
NOTE : Make sure /dev/sdb is your NEW EMPTY drive. This will take time depending on the size of your disk but when complete your new drive will be ready to boot and will be an identical copy of you current system. Ofcourse your new drive needs to be of the same / larger size.
Your NIC naming will change on the new system, just modify /etc/udev/rules.d/70-persistent-net.rules file and rename as required.
Good luck.
I think that the better way to migrate is install Debian on the new server and configure it properly , then copy only what you need, for example website root folder, configuration file and so on ...
Do not copy everything but just what you really need is my suggestion.
Do not just copy everything, it will not work. Set up a new Debian server and test is. Once you are certain everything is OK, move what you need. (Databases, Webfiles,...).
When you just tar the root filesystem, and extract it on the new server you will end up with a broken system.