Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to migrate from one server to another. I was going to try backing up the hd using dd, but there's a problem.
My old server has one main partition (/) and a swap partition. But I did the RIGHT thing on my new server and put /boot, /home, /usr and /var on their own partitions.
What's the best way to migrate from the old server to the new one?
Since you are changing your partitioning scheme, you won't be able to use dd, at least not without moving things around afterward. I would think your best bet would be to use cp or rsync. If you are copying across a network you could use rcp or scp in place of cp. (rcp is not recommended unless your network is completely trustworthy.)
After copying everything, you will need to install the boot loader on the the new machine. (Simply copying the MBR won't work.) You can do this by booting from a live CD. If you are using GRUB, you can issue the GRUB commands directly. If you are using LILO, you should first mount your / on a temporary mount point and mount your /boot partition normally, and then chroot into your temporary mount point and run lilo. With LILO, make sure you don't mount the root of your new file system nodev.
I would simply add that if you chose to use cp, do it as "cp -a ..."
And likewise for rsync. AND ... (now that you reminded me!) neither scp nor rcp should be used because (TMK) there is no option for those to handle symlinks properly.
BTW syg00, your sig is really good. I'd use it in my own sig if "borrowing" wasn't such poor form!
Last edited by blackhole54; 06-24-2007 at 09:32 PM.
Thanks for both of those suggestions. So one final question:
Let's say I use cp -a. Is there anything I SHOULDN'T copy from the old system to the new one? Since the hardware is different, I wouldn't want to copy anything that would mess that up.
Should I leave /boot alone, since it already works? Or should I copy everything from the old system to the new one, then boot from a live CD?
All of the copying should be done from a liveCD - mitigates having to worry about the pseudo filesystems; principally /dev and /proc.
Goes without saying the source server should be shut down first.
Copy the appropriate entire tree to each new partition - then fix the bootloader. I like to do it from the new /boot, but probably not strictly necessary; can be done from the code base on the liveCD.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.