How to copy entire contents from existing Linux server to new PC
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
How to copy entire contents from existing Linux server to new PC
Hello,
I'm done a few searches and I'm having difficulty figuring out which is the best way of accomplishing my goal. I'm trying to take an old stand alone linux server and copy the entire system (possibly called mirroring) to a new and separate PC which is running Windows (I am ok with completely overwriting the contents of the Windows PC with the contents from the Linux box).
The system I want to copy is currently:
# cat /proc/version
Linux version 2.6.18-92.1.18.el5 (mockbuild@builder16.centos.org) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Wed Nov 12 09:30:27 EST 2008
# fdisk -l
Disk /dev/hda: 30.7 GB, 30738677760 bytes
255 heads, 63 sectors/track, 3737 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Device Boot Start End Blocks Id System
/dev/hda1 * 1 13 104391 83 Linux
/dev/hda2 14 3640 29133877+ 83 Linux
/dev/hda3 3641 3737 779152+ 82 Linux swap / Solaris
Does anybody know the best way to go about this? Do I need to remove the Windows hard drive and install it into the Linux box (I would rather not have to do this if I can avoid this). Can this be done via cross-over ethernet cable between the 2 devices?
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
i would install the same distribution on the target system as the new systems, install the same packages as exists on the existing server, make sure both installs are up to date, create any users from the old system on the new system, then copy /var, /etc/ and /home, making sure to chown the individual home directories to the new uids on the new system. only those folders for the most part contain information that can be altered by users/administrators/software (for instance mysql is /var/lib/mysql, and apache is /var/www{/html} by default), the rest is stuff that comes from packages and isn't altered except by a software update.
The word "best" can get you a hundred varied responses, but what I'd do is tar the entire thing for easier copying. You might take manual steps first to put things like crontabs in more friendly locations, but that's just preference (see above).
Next I'm assuming you mean the Windows box will take over the function of your current Linux system. If that's correct, there's no need to swap hardware. I'd wipe the Windows drive and give it a fresh Linux install--same distro is probably preferred--then copy the tarball to the new system in a backup directory, ready to cherry-pick individual files, such as httpd.conf, dhcpd.conf, et cetera. Keep in mind whether any file's ownershit is relevant to its function--serving web pages from user home directories and such.
Since the current Linux box is significantly older, you'll want to be very careful about dropping configuration files into a newer environment. Applications change, and the old config might not work anymore (Nagios comes to mind).
This is where you stand to perform more manual conversions and potentially wonder if the backup was worthwhile, or if it would've been easier to simply recreate everything from scratch. Only you can decide that, based on your familiarity with configuring whatever will run on the box. Of course served content and media archives are exempt from that part.
If the HW is the same, you can use http://www.mondorescue.org/ or Clonezilla or hot-swap/mirroring if you have already got the capability.
Otherwise, re-building the OS separately, then copying over the Apps/data will probably do.
Definitely take a couple of backups first.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.