Answer the question
In order to leave comments, you need to log in
Transferring the system to a new server
Hello. There is a fully built server on Debian 6. There was a need to transfer all this stuff to another server, due to a change in provider. How can you easily and quickly transfer all this? Is it possible to remove, for example, an image, and somehow upload it to a new one? For example, LVM Snapshot'om?
Answer the question
In order to leave comments, you need to log in
1) stop all unnecessary services (especially if there are databases) and leave sshd running
2) run on your machine:
ssh [email protected] tar --checkpoint=.10 --totals --create --gzip --one-file- system / > myserver.tgz
where server is the address of your server, and myserver.tgz is the archive into which your server data will be copied
3) if your disk is divided into several partitions (i.e. /var /boot, etc. mounted separately), then repeat the operation for them too, for example:
ssh [email protected] tar --checkpoint=.10 --totals --create --gzip --one-file-system /boot > myserver_boot.tgz
4) create a partition and the file system on the new server
5) unzip the backups there
6) boot from livecd, mount the partition you created, e.g. /mnt
7) mount dev inside the new partition, e.g.:
mount /dev /mnt/dev -o bind
8) chroot to /mnt and restore the bootloader with grub- install
9) check the new system's /etc/fstab for the UUID (if you mount the system by UUID)
This is usually enough to get a working system.
If you can get a full snapshot of the current system (with all partitions and bootloader, i.e. the entire virtual HDD), then everything is much easier. Just copy the snapshot to your location and upload it to your hard drive with dd.
Synchronizing via rsync, in principle, is even enough. Especially handy if you want to change partition configuration or file system.
If it is possible to boot into another OS (netboot, LiveCD, etc.), then any option with transferring the entire disk image.
As another alternative to rsync, archive the contents of the server 's tar disks , move the archive, unpack it in a new location, and reinstall the bootloader.
Gentoo people call it stage. There is a good description of working with stage5 : how to create an archive and how to deploy it - just what you need (with some adjustments for gentoo's specifics)
But this method is suitable if it is possible to boot from any LiveCD.
This method is better than images in that it allows you to transfer the system to disks with a fundamentally different breakdown (and even with other file systems).
What people don’t do just to not do it right, and the right way is virtualization, you just migrate the virtual machine and voila, you need to make minimal efforts.
Utilities for converting a real server into a virtual one for vmware, xen, kvm, openvz seems to me to be enough.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question