FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 09-01-2010, 07:33 AM
Aniruddha
 
Default What is the best way to migrate a server to new hardware?

Hi,

I wonder what the best way is to move a (non mission-critical) Debian
server installation to a new server. Rsync, clonezilla, tar, mondo,
dpkg-selections? With Gentoo I used to tar root, unpack it on the new
server, adjust config files and reinstall grub.I wonder what the
proper way in Debian is. Thanks in advance!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTimqAuC1ODL9R9qwf-tDg82GdusL8jPOrG+W8sN+@mail.gmail.com">http://lists.debian.org/AANLkTimqAuC1ODL9R9qwf-tDg82GdusL8jPOrG+W8sN+@mail.gmail.com
 
Old 09-01-2010, 07:53 AM
Bob Proulx
 
Default What is the best way to migrate a server to new hardware?

Aniruddha wrote:
> I wonder what the best way is to move a (non mission-critical) Debian
> server installation to a new server. Rsync, clonezilla, tar, mondo,
> dpkg-selections? With Gentoo I used to tar root, unpack it on the new
> server, adjust config files and reinstall grub.I wonder what the
> proper way in Debian is. Thanks in advance!

There isn't one canonically correct answer. There are many different
ways to do it and different people will have different favorite
methods.

I like booting the new machine with a live cdrom and then using rsync
to clone the old system onto the new system's disk over the network.
Then install grub and boot the new system. If I want to set up disk
mirroring then I do that first by using the debian-installer to do the
work first so that it is ready to go and then do the rsync on top of
it.

At other times I will move the new disks onto the old system, mount
them and do the copy locally, then move them back into the new machine
and boot it.

Bob
 
Old 09-01-2010, 07:57 AM
"Chris"
 
Default What is the best way to migrate a server to new hardware?

I like the dpkg method myself. Of course this won't help if you have lots of custom conf file in etc.

In that case, creating a tarball of etc would remedy that.

Clonezilla is another option I like if you want an exact duplicate (I have used both methods and its a toss up for me what is the better solution)

Of course, your mileage may vary.
Sent from my BlackBerry®

-----Original Message-----
From: Aniruddha <mailingdotlist@gmail.com>
Date: Wed, 1 Sep 2010 09:33:42
To: <debian-user@lists.debian.org>
Subject: What is the best way to migrate a server to new hardware?

Hi,

I wonder what the best way is to move a (non mission-critical) Debian
server installation to a new server. Rsync, clonezilla, tar, mondo,
dpkg-selections? With Gentoo I used to tar root, unpack it on the new
server, adjust config files and reinstall grub.I wonder what the
proper way in Debian is. Thanks in advance!


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/AANLkTimqAuC1ODL9R9qwf-tDg82GdusL8jPOrG+W8sN+@mail.gmail.com
 
Old 09-01-2010, 03:55 PM
Aniruddha
 
Default What is the best way to migrate a server to new hardware?

On Wed, Sep 1, 2010 at 9:53 AM, Bob Proulx <bob@proulx.com> wrote:
> I like booting the new machine with a live cdrom and then using rsync
> to clone the old system onto the new system's disk over the network.
> Then install grub and boot the new system.


> At other times I will move the new disks onto the old system, mount
> them and do the copy locally, then move them back into the new machine
> and boot it.

Thank you for you help. Which rsync command do you use? And how you
restore grub? With the live cd? Or manually with a random livecd?
Which command do you use to copy them them locally? I'm curious how
other users solve this


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTinSbko13G8acH5urXioZt2EmGiU8cGJjbbp+Bhp@mail .gmail.com">http://lists.debian.org/AANLkTinSbko13G8acH5urXioZt2EmGiU8cGJjbbp+Bhp@mail .gmail.com
 
Old 09-01-2010, 04:01 PM
Aniruddha
 
Default What is the best way to migrate a server to new hardware?

On Wed, Sep 1, 2010 at 9:57 AM, Chris <racerx@makeworld.com> wrote:
> I like the dpkg method myself. Of course this won't help if you have lots of custom conf file in etc.
>
> In that case, creating a tarball of etc would remedy that.
>
> Clonezilla is another option I like if you want an exact duplicate (I have used both methods and its a toss up for me what is the better solution)

Thanks, I can use a 'tar ball copy' in Debian without problems?
Here's what I did in Gentoo, will this work in Debian. Is there
another recommended way to tar and move an OS?

# rm /etc/ssh/ssh_host*
# rm -iv /etc/resolv.conf
# tar cvjfp /mnt/usb/stage4.tar.bz2 / -X debian.excl

# cat debian.excl
/etc/ssh/ssh_host_*
/home/*
/mnt/*
/media/*
/lost+found
/proc/*
/sys/*
/tmp/*
/var/tmp/*


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTineTc4zF+-+2+S2MJL5HbvDi7W5Ub+EL0F2jb0s@mail.gmail.com">http ://lists.debian.org/AANLkTineTc4zF+-+2+S2MJL5HbvDi7W5Ub+EL0F2jb0s@mail.gmail.com
 
Old 09-01-2010, 04:18 PM
Chris
 
Default What is the best way to migrate a server to new hardware?

On Wed, 1 Sep 2010 18:01:42 +0200
Aniruddha <mailingdotlist@gmail.com> wrote:

> On Wed, Sep 1, 2010 at 9:57 AM, Chris <racerx@makeworld.com> wrote:
> > I like the dpkg method myself. Of course this won't help if you
> > have lots of custom conf file in etc.
> >
> > In that case, creating a tarball of etc would remedy that.
> >
> > Clonezilla is another option I like if you want an exact duplicate
> > (I have used both methods and its a toss up for me what is the
> > better solution)
>
> Thanks, I can use a 'tar ball copy' in Debian without problems?
> Here's what I did in Gentoo, will this work in Debian. Is there
> another recommended way to tar and move an OS?
>
> # rm /etc/ssh/ssh_host*
> # rm -iv /etc/resolv.conf
> # tar cvjfp /mnt/usb/stage4.tar.bz2 / -X debian.excl
>
> # cat debian.excl
> /etc/ssh/ssh_host_*
> /home/*
> /mnt/*
> /media/*
> /lost+found
> /proc/*
> /sys/*
> /tmp/*
> /var/tmp/*
>
>

Here's one way that I would do this:

On the new box:
Install Debian per normal.

Old Box:
#sudo dpkg --get-selections "*" >> installed_packages.txt
copy the file, installed_packages.txt to the new box

On Newly install Debian:
#sudo dpkg --set-selections < installed_packages.txt
#sudo apt-get -u dselect-upgrade

This will read the file installed_packages.txt
and will install these into the new Debian system.

Once that's up to date, take your tarball of /etc from the old box,
dump it to a temp dir in the new, decompress it, copy the .conf files
that you modified (and any other dirs/files you yourself have created
to /etc on the new box.

This method has a little work to be done (and thank you Howtoforge for
the nifty little trick) but works pretty well for my needs.

This same process will work for a workstation also. Then again,
Clonezilla (again, one that I use often when I want to archive my
system and need to restore on the same hardware at any given point)
should work also.

But as others have pointed out, there are many ways to do this. You
just need to blaze your own path and see what works best for you.

--
Best regards,

Chris
1AB5FEF8


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100901111838.01449e90@makeworld.com">http://lists.debian.org/20100901111838.01449e90@makeworld.com
 
Old 09-01-2010, 08:09 PM
Mike Viau
 
Default What is the best way to migrate a server to new hardware?

> On Wed, 1 Sep 2010 11:18:38 -0500 <racerx@makeworld.com> wrote:
>
> > On Wed, Sep 1, 2010 at 9:57 AM, Chris <racerx@makeworld.com> wrote:
> > > I like the dpkg method myself. Of course this won't help if you
> > > have lots of custom conf file in etc.
> > >
> > > In that case, creating a tarball of etc would remedy that.
> > >
> > > Clonezilla is another option I like if you want an exact duplicate
> > > (I have used both methods and its a toss up for me what is the
> > > better solution)
> >
> > Thanks, I can use a 'tar ball copy' in Debian without problems?
> > Here's what I did in Gentoo, will this work in Debian. Is there
> > another recommended way to tar and move an OS?
> >
> > # rm /etc/ssh/ssh_host*
> > # rm -iv /etc/resolv.conf
> > # tar cvjfp /mnt/usb/stage4.tar.bz2 / -X debian.excl
> >
> > # cat debian.excl
> > /etc/ssh/ssh_host_*
> > /home/*
> > /mnt/*
> > /media/*
> > /lost+found
> > /proc/*
> > /sys/*
> > /tmp/*
> > /var/tmp/*
> >
> >
>
> Here's one way that I would do this:
>
> On the new box:
> Install Debian per normal.
>
> Old Box:
> #sudo dpkg --get-selections "*" >> installed_packages.txt
> copy the file, installed_packages.txt to the new box
>
> On Newly install Debian:
> #sudo dpkg --set-selections < installed_packages.txt
> #sudo apt-get -u dselect-upgrade
>
> This will read the file installed_packages.txt
> and will install these into the new Debian system.
>

Does this method mark the previously packages that were auto as such on the new system, or are they all considered installed manually?

> Once that's up to date, take your tarball of /etc from the old box,
> dump it to a temp dir in the new, decompress it, copy the .conf files
> that you modified (and any other dirs/files you yourself have created
> to /etc on the new box.
>
> This method has a little work to be done (and thank you Howtoforge for
> the nifty little trick) but works pretty well for my needs.
>
> This same process will work for a workstation also. Then again,
> Clonezilla (again, one that I use often when I want to archive my
> system and need to restore on the same hardware at any given point)
> should work also.
>
> But as others have pointed out, there are many ways to do this. You
> just need to blaze your own path and see what works best for you.
>
 
Old 09-02-2010, 04:13 PM
Bob Proulx
 
Default What is the best way to migrate a server to new hardware?

Aniruddha wrote:
> Bob Proulx wrote:
> > I like booting the new machine with a live cdrom and then using rsync
> > to clone the old system onto the new system's disk over the network.
> > Then install grub and boot the new system.
>
> > At other times I will move the new disks onto the old system, mount
> > them and do the copy locally, then move them back into the new machine
> > and boot it.
>
> Thank you for you help. Which rsync command do you use? And how you
> restore grub? With the live cd? Or manually with a random livecd?
> Which command do you use to copy them them locally? I'm curious how
> other users solve this

I should have mentioned it but the only interesting rsync option that
is needed is --numeric-ids. That uses the owner and group ids
verbatim without the default name mapping to the uids of the currently
running system. Using --numeric-ids is normal for backup and verbatim
data transfer such as this.

rsync -av --numberic-ids --exclude /proc --exclude /dev oldhost:/ /target/

Normally I would explicitly copy any individual filesystem such as
/home or /usr/local individually. The -x, --one-file-system option
may be useful in the multiple partition case copying from a live
filesystem.

/dev is a little problematic. What you want there is a raw version
but the running system has a cooked version. I will usually copy that
from a debootstrap'd /dev that is idle. I will leave this as a little
bit of an exercise for the reader.

Copying from a local disk to a local disk is the same but then since
the local disk is idle there isn't anything in the proc and dev is the
idle dev and so this is simpler.

rsync -av --numberic-ids /mnt/olddisk/ /mnt/newdisk/

Again, individual filesystems on individual partitions would need to
be created and copied individually.

rsync -av --numberic-ids /mnt/olddisk/var /mnt/newdisk/
rsync -av --numberic-ids /mnt/olddisk/home /mnt/newdisk/
rsync -av --numberic-ids /mnt/olddisk/usr/local /mnt/newdisk/
... and so forth ...

There is much other documentation on restoring grub so I won't go into
detail there. I boot a live cd and then chroot into the system and
run grub-install there to install grub onto the MBR.

I also make good use of a live cd that uses grub itself. Then I can
interactively tell grub booting from the cdrom to boot the new system.
This way the new system is booted exactly as it will once grub is
installed on the new disks. Then I run grub-install on the newly
booted system to set up the MBR and reboot to test it. However most
live cdroms use syslinux instead and so locating a grub booting cdrom
boot system can be challenging. You may end up resorting to building
your own grub based cdrom system instead. In my case for this
scenario I don't care about what is actually on the disk. I just want
to get to an interactive grub session so that I can interactively boot
the new system.

Sorry that the information here is a little "fuzzy".

Bob
 
Old 09-02-2010, 11:35 PM
Martin Kraus
 
Default What is the best way to migrate a server to new hardware?

On Thu, Sep 02, 2010 at 10:13:49AM -0600, Bob Proulx wrote:
> Aniruddha wrote:
> > Bob Proulx wrote:
> > > I like booting the new machine with a live cdrom and then using rsync
> > > to clone the old system onto the new system's disk over the network.
> > > Then install grub and boot the new system.
> >
> > > At other times I will move the new disks onto the old system, mount
> > > them and do the copy locally, then move them back into the new machine
> > > and boot it.

Isn't using tar the easiest way? boot from finnix iso, create software
raid,lvm or whatever you need, then tar one system with --numeric-owner
parameter and pipe it through ssh to the destination system.
mount --bind /dev to the new system, chroot into it, install grub and restart.

mk


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: http://lists.debian.org/20100902233545.GR30293@/bin/hostname
 
Old 09-03-2010, 01:31 AM
Bob Proulx
 
Default What is the best way to migrate a server to new hardware?

Martin Kraus wrote:
> Bob Proulx wrote:
> > > > I like booting the new machine with a live cdrom and then
> > > > using rsync to clone the old system onto the new system's disk
> > > > over the network. Then install grub and boot the new system.
> > >
> > > > At other times I will move the new disks onto the old system,
> > > > mount them and do the copy locally, then move them back into
> > > > the new machine and boot it.
>
> Isn't using tar the easiest way? boot from finnix iso, create
> software raid,lvm or whatever you need, then tar one system with
> --numeric-owner parameter and pipe it through ssh to the destination
> system. mount --bind /dev to the new system, chroot into it,
> install grub and restart.

As I said before there isn't one canonically correct way. Different
people will have their favorite methods. In this case the concept of
cloning the filesystem is the same. One just uses tar and ssh and
other uses rsync and ssh. Neither is wrong and neither is The One
True way. A third person might like cpio over tar. A forth person
might like dd. A fifth person might like 'mondo', which I am a little
surprised that no one mentioned yet.

Bob
 

Thread Tools




All times are GMT. The time now is 03:06 AM.

VBulletin, Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org