0

I have this Linux (Debian) server that I want to duplicate, with all its services and their settings. Actually, it is to replace the existing server with newer hardware. I'd like the process to be as painless as possible.

So I was thinking, that I could do a fresh install of the same version of OS (with the appropriate binary format, of course) to the newer hardware. Then install the additional software packages (I have a list of all the apt-get install commands from the old machine that I can turn into a script of sorts. Then copy the /var, /etc, /home and /root directories over from the old machine to the new one.

My question is, has anyone tried it? What hiccups/pitfalls were encountered during the process? Was it even successful, or am I just planning an exercise in futility?

I am willing to go through if no one has tried it, and it should work "in theory", so any other ideas are also welcome.

Hammad Akhwand
  • 151
  • 1
  • 1
  • 5
  • Set up the new server with a proper configuration management system. Then you'll never need to worry about this painful process again. – EEAA Feb 27 '14 at 05:17
  • @Hammand in best case, you will get the list of installed packages. All you configurations made by hand will be lost. Follow suggestion from EEAA and use something like puppet or chef to avoid the same pain in the future. – kofemann Feb 27 '14 at 07:26
  • 1
    One option would be to install VMware ESXi (free) on the new hardware and performa P2V conversion of the actual Linux server. Then you can stay or perform any kind of reinstall test on a second vm running a fresh installation of Linux side-by-side on the same host. – Danilo Brambilla Mar 05 '14 at 14:57

1 Answers1

0

Remember that when you do the command "apt-get install" on your new server, that would pull new version packages from repository, may get you in trouble of conflict packages.

I have another idea that I tried several years ago: You plug your new harddisk into current system, create partitions with the same layout of your Debian system (number of partitions, the last partition could be bigger due to differ from harddisk size). Then you boot into rescue usb, use 'dd' command to make a binary clone of each partition to new harddisk. After this phase, you would have the same data on new harddisk, except the bootloader. The last thing you should do is, plug your new harddisk into your new system, install a bootloader by yourself (via rescue usb), and boot into the OS.

incous
  • 136
  • 4
  • "...use 'dd' command to make a binary clone..." what about the binary executables in /bin /sbin and the shared objects in /lib that are not binary-compatible with the newer processor? I regularly update packages on the current servers, and most of the software packages I have installed have their counterparts in repositories for both cpus. The version discrepancy should not be a problem. – Hammad Akhwand Feb 27 '14 at 10:03
  • so your way may get the work done. actually, you just want new server runable with the same config, but this way may be more painful than setting up a new one & get experience. btw, your solution was not so time-consuming, it worth to try. – incous Feb 27 '14 at 10:11