View previous topic :: View next topic |
Author |
Message |
ckx3009 Guru
Joined: 08 Apr 2008 Posts: 362 Location: Milano, Italy
|
Posted: Mon Sep 02, 2013 8:19 pm Post subject: migration from one server to another one |
|
|
Hello,
Since some time I have one server with an updated gentoo OS, the user folders, some services, a website and so on.
Now I'm getting an other server with exactly the same hardware (except for the RAM memory, which is doubled on the new one).
My intention would be to copy the whole disk from the old server to the new one, but the problem is that I cannot physically access the servers, I can only control them via SSH so I probably need some tricks in order to be able to copy the whole system and overwrite on the new system all the files, included those that should be in use.
Any suggestion on what is the best way to proceed?
Thank you very much!
Regards
ckx3009 |
|
Back to top |
|
|
mahnmut n00b
Joined: 13 Nov 2012 Posts: 16
|
Posted: Mon Sep 02, 2013 8:39 pm Post subject: |
|
|
Can you start on a live cd via an idrac or somthing like this ?
If yes, start the 2 server on a livecd, configure the network and root passord.
after do this on the new server : ssh root@oldserver "cat /dev/sda" > /dev/sda
repeat it for all hard drive you have.
I use this way and it work fine.
Boot the old server on live cd is no obligatory but i think it's a good idea.
Don't forget if you have some config file like network to edit to reboot the new server on the live cd again and to modify these files. |
|
Back to top |
|
|
ckx3009 Guru
Joined: 08 Apr 2008 Posts: 362 Location: Milano, Italy
|
Posted: Tue Sep 03, 2013 5:46 pm Post subject: |
|
|
Hello mahnmut,
I have no direct access to the two servers since they are something like 1000 Km far from me.
I need to do everything in SSH or, at least, something like webmin.
Thank you very much!
Regards
ckx3009 |
|
Back to top |
|
|
mahnmut n00b
Joined: 13 Nov 2012 Posts: 16
|
Posted: Tue Sep 03, 2013 6:01 pm Post subject: |
|
|
Have you an idrac or something like ip kvm to boot on iso image ?
else i think it's hard. |
|
Back to top |
|
|
nativemad Developer
Joined: 30 Aug 2004 Posts: 918 Location: Switzerland
|
Posted: Tue Sep 03, 2013 6:16 pm Post subject: |
|
|
mahnmut wrote: |
after do this on the new server : ssh root@oldserver "cat /dev/sda" > /dev/sda
repeat it for all hard drive you have.
|
Iksch!? You shouldn't do that.
If the drives aren't exactly to the point the same, you'll just end up with a damaged partition table! -And I've seen brand new servers that had 6 sas disks locally from one vendor in it, but half of them were from a different series with a slightly different disk layout...
It is also much faster and more flexible if you just take the part that is actually in use...
I always do it like this:
1. boot the target from a live media
2. create the partitions, mkfs and mount them somewhere
3. watch out that /boot is mounted on the source machine
4. rsync -urlvopgtD --exclude=/sys/* --exclude=/proc/* root@source-machine:/* /target/mountpoint/
5. write the bootloader
6. delete /etc/udev/rules.d/70-persistent-net-rules and adjust /etc/conf.d/net as well as probably fstab and the hostname
7. unmount and reboot
Cheers _________________ Power to the people! |
|
Back to top |
|
|
creaker l33t
Joined: 14 Jul 2012 Posts: 651
|
Posted: Tue Sep 03, 2013 8:17 pm Post subject: |
|
|
I would have packed all the server (OS and data) into stage4 archive, moved it to new hardware and unpacked it.
Since you have ssh access only, it is better to move packed archive rather than move non-packed raw data over the net. |
|
Back to top |
|
|
ckx3009 Guru
Joined: 08 Apr 2008 Posts: 362 Location: Milano, Italy
|
Posted: Wed Sep 04, 2013 8:55 pm Post subject: |
|
|
Hello creaker,
I could do a stage 4 archive and unpack it on the new system, but what would happen to the in-use files?
I would surely overwrite some of them in the unpacking process. Isn't it important? Can I proceed anyway?
Hello nativemad,
unfortunately I'm not able to boot on a live media, otherwise it would be easy to simply live-mount both hard drives and copy from the old one to the new one.
I repeat: the only access I have is SSH directly to the server.
Thank you very much!
Regards
ckx3009 |
|
Back to top |
|
|
nativemad Developer
Joined: 30 Aug 2004 Posts: 918 Location: Switzerland
|
Posted: Mon Sep 09, 2013 2:08 pm Post subject: |
|
|
okok, then the only safe way would be through repartitioning on the target... You'll need a new partition to prepare the new system! _________________ Power to the people! |
|
Back to top |
|
|
|