I have the following problem: We have a dedicated (bare metal) hardware server (Debian 10) on which we have no direct physical access. Now I want to transfer all data and applications that are on this server to a VM and run it on a KVM host.
Why do I not install the application directly in the VM? The installation of this application (Perl stuff with Apache web server, running on the same server for about 10 years) is so complex that you would rather break something. So nobody dares to do it. But now we have to move and for this reason we need some kind of smart workaround.
I thought about switching off all Perl and Apache services and transferring the hard disk via
dd over the network - but the problem is that the target KVM host has less space than the
sda from the bare metal server is big (in the end it uses less space than is available,
sda is just oversized).
The second option would be to install the same packages on the KVM with exactly the same version numbers (according to
dpkg --list), disable all services on the bare metal server (to keep the data consistent) and put
/usr and everything else that is important from the bare metal server into a tarball and simply unpack it on the KVM. Of course I could also do this via rsync, but the principle is more or less the same.
What do you think about the last idea?
Do you have any other ideas?
How would you proceed with such a task?