Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
migration from one server to another one
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
ckx3009
Guru
Guru


Joined: 08 Apr 2008
Posts: 362
Location: Milano, Italy

PostPosted: Mon Sep 02, 2013 8:19 pm    Post subject: migration from one server to another one Reply with quote

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
View user's profile Send private message
mahnmut
n00b
n00b


Joined: 13 Nov 2012
Posts: 15

PostPosted: Mon Sep 02, 2013 8:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
ckx3009
Guru
Guru


Joined: 08 Apr 2008
Posts: 362
Location: Milano, Italy

PostPosted: Tue Sep 03, 2013 5:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
mahnmut
n00b
n00b


Joined: 13 Nov 2012
Posts: 15

PostPosted: Tue Sep 03, 2013 6:01 pm    Post subject: Reply with quote

Have you an idrac or something like ip kvm to boot on iso image ?

else i think it's hard.
Back to top
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 816
Location: Switzerland

PostPosted: Tue Sep 03, 2013 6:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
creaker
Guru
Guru


Joined: 14 Jul 2012
Posts: 480

PostPosted: Tue Sep 03, 2013 8:17 pm    Post subject: Reply with quote

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.
_________________
Intel Core i3-2120 / 4Gb RAM / 250Gb HDD / NVidia GeForce-550Ti
Back to top
View user's profile Send private message
ckx3009
Guru
Guru


Joined: 08 Apr 2008
Posts: 362
Location: Milano, Italy

PostPosted: Wed Sep 04, 2013 8:55 pm    Post subject: Reply with quote

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
View user's profile Send private message
nativemad
Developer
Developer


Joined: 30 Aug 2004
Posts: 816
Location: Switzerland

PostPosted: Mon Sep 09, 2013 2:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum