Results 1 to 9 of 9
Hi all,
I've been asked to look into moving the contents of 1 linux server which has samba, php, mysql, apache and some other bits installed, to a brand new ...
- 04-21-2010 #1Just Joined!
- Join Date
- Apr 2010
- Posts
- 1
Copy linux setup from 1 box to another.
Hi all,
I've been asked to look into moving the contents of 1 linux server which has samba, php, mysql, apache and some other bits installed, to a brand new server which currently only has the os. Is there an easy way of doing this by copying the files/directories straight over or would we need to build all the software from fresh again on the new box? They are both on different IPs so I'm guessing I'd need to update some configs and if I can avoid taking the current box offline then that would also be useful.
I'm fairly limited in my linux knowledge so any help is appreciated.
Thanks in advance.
- 04-21-2010 #2forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
Hello and welcome!
One of the easiest ways to migrate to another machine is to create a system image of the current system, then restore that image to another machine. There are a number of different applications that can do this, including Clonezilla, FSArchiver, Ghost4Linux, Mondo, and PartImage, or you could use the dd command. Each of these have pros and cons associated with them so you'd need to determine which if any would best suit your own purpose for using it.
Maybe some of the others here will offer up additional suggestions.oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 04-21-2010 #3
Hmm, imaging seems overkill to me.
Is the old server set up by using packages only,
aka: no sources manually compiled?
If yes,
- make a list of the installed packages
- install the same on the new server
- then copy and modify (IP, hostnames, etc) the config files for apache, samba, etc
- then copy the data over with rsync
- test
You must always face the curtain with a bow.
- 04-22-2010 #4
Ozar and Irithori both make good suggestions. Imaging will ensure complete fidelity to the original server without having to understand all of its intricacies, but will certainly require taking the existing server offline, and may not be appropriate to taking full advantage of the new hardware. If there's a lot more disk space on the new server, you might need to jump through some serious hoops in an image scenario. And if it's a 32bit to 64bit OS migration, it wouldn't work for you.
Irithori's laundry list for a parallel migration is pretty good. I've done this type of migration many times, and if you follow those steps and test the new box appropriately, you can then do a cutover by having the new box assume the old one's IP and hostname after a final rsync of the data with the services on the old box shut down. Rsync is definitely your best friend in this scenario. BUT, in order to do a migration like this, you have to develop a full understanding of all of the services/configurations you're replicating.
Good luck!
- 04-22-2010 #5Just Joined!
- Join Date
- Mar 2010
- Posts
- 1
There are many solutions, but that basically depends on how different the 2 machines are (will be).
Do you want to keep the same distribution / version?
If you only want to migrate from 1 to the other with no modification I'd suggest the following (but you need to know the distribution used pretty well):
- Take a live-cd and boot the new machine.
- Partition it to your needs and format the filesystems.
- Then mount them in the /mnt (or whatever) in the same order you will be mounting them when it starts up.
- enter the /mnt and use rsync to copy over everything to the /mnt
- chroot into /mnt and do the appropriate changes (hostname / modules / fstab) if needed (this is the most triky part as you need to know what you are doing.
- install the bootloader (grub)
- exit the chroot / umount the partitions and reboot
- If you want to test, first be sure to have changed the Ip address
- The you can run rsync again to align the eventually modified files (i.e. mysql).
- You'll need to have some downtime if you use anything that changes during time, but it will be pretty fast to rsync again only thoose parts
- 04-22-2010 #6
I've doen it many times. I used clonezilla from a USB stick to copy partitions from one disk to another but you need to take care that you do not mess up with partition labels, i. e. if you already have a partition labeled as /, a new one might be renamed and so booting from it fails. Also, if you decided not to copy the MBR / bootmanager you need to fix it manually. So I installed the OS just again and copied directories and files with cp -a
rsync is a good alternative but you can also try GUI enabled software like Goodsync and Dropbox.
- 04-22-2010 #7forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,095
Right... it might be overkill, but the real advantage to cloning is the speed in getting the job done.
I can clone my own system to another drive in around 6 minutes, and that includes imaging the first system and then restoring it to the secondary system. I'd think that should prove to be much faster than most any other method of migrating to another machine. Of course, if time is of no concern then speed doesn't matter.
Redlorry, do let us know how it goes with whatever route you should choose.oz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 04-22-2010 #8
Hi!
If I may ask, can the OP use MC to do the job for this particular task?nujinini
Linux User #489667
- 04-23-2010 #9


Reply With Quote
