D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] Migrating/merging servers...

 

Grant Sewell wrote:
> Hi all,
>
> As I've alluded to in the past, it is my intention to merge my existing 
> mailserver and webserver into my existing fileserver... I only ever had 
> them separated so that I could get one working without risking breaking 
> the other.  Now that I'm happy they all work nicely, I want to merge 
> them. :)
>
> So, I've established that possibly the easiest thing to do would be find 
> out what packages are installed on each server (done), and simply 
> apt-get install the appropriate ones onto the target machine (it's 
> already running Debian Stable).  Moving the files from the webserver 
> shouldn't be a problem - I tend to keep *everything* in /var/www so I 
> only have one place to copy over.
>
> Here's my current crunch...
>
> On the target machine, I have a nice big harddrive with plenty of data 
> on it, currently mounted at /mnt/200... ideally, I'd like to have that 
> remounted as /var (because I'm gonna have /var/www, /var/shared on there 
> shortly), however there are currently lots of files/directories on the 
> existing /var directory.
>
> So, how can I duplicate the current /var structure onto the 200GB drive, 
> remove the current /var structure and the remount the 200GB drive as 
> /var... possibly without having to reboot?
>
> Or would something along these lines be infinitely easier to do using 
> another system, such as Knoppix... ie boot to the other system, make the 
> necessary changes, reboot back to the working system?
>
> Cheers.
> Grant
When I've done this myself I've booted into Knoppix or an Ubuntu Live 
CD.  I have then created and formatted the partitions I want on the 
destination drives.  I then mount the destination drive under sometime 
like /mnt/new and and the original partition under something like 
/mnt/old.  I then copy what I need to copy over to the new drive.

I would use a command line like...

cp -Rv /mnt/old/* /mnt/new

Which would copy all files and folders from /mnt/old to /mnt/new 
recursively (so everything under /mnt/old).

I'd then make sure I updated the /etc/fstab to point to the new 
partition (adding the mount point and partition if required).

Note, this is coming from memory so it might be slightly wrong.  Anyone 
want to confirm if I am correct or not?

Ta,

Rob




-- 
The Mailing List for the Devon & Cornwall LUG
http://mailman.dclug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html