machine migration from 5.3 to 6.3

Derek Ragona derek at computinginnovations.com
Mon Jan 28 14:38:25 PST 2008


At 03:51 PM 1/28/2008, Josh Tremor wrote:
>Okay, I had a freshly installed 6.3 on a machine (thanks Derek
>Ragona), and my intention is to use this new installation as a direct
>replacement of an older 5.3 box.  This means using the same host name,
>IP address, and services.  I want to make sure I've crossed all the
>t's.
>
>I installed ilohamail and since I'm using mysql for the database, I
>need to bring over the tables.  So I use mysqladmin to copy all
>databases and their tables from the old box and restore them on my new
>box.
>
>Copy over my users' home directories, and copy the /etc/master.passwd
>and /etc/passwd files.
>
>I need to bring over the old httpd.conf file so my virtual hosts are
>preserved.  Also bring over the related directories with content.
>
>Run #hostname <new.name> to change the hostname, and edit the
>/etc/rc.conf file to make the change permanent.  Edit the /etc/hosts
>file also, or copy over the old one.
>
>To change the address, vi the /etc/rc.conf file to edit the if_config
>lines (disconnect the old box from the network, first) and run
>#/etc/netstart
>
>Now I'm really unsure of this step:  since this box is an important
>dns host, couldn't I copy the entre /var/named structure over?  Or is
>is best to create fresh ones?  It was well over two years ago when I
>set bind/rndc up, and I remember not enjoying that.  I was hoping to
>use the same zone records.
>
>
>I'm the only one who ssh's in, so I don't care about those keys, but
>my main concern is to have the mail/dns flowing the way it was before.
>  The mail is handled by a third party's (Sophos) own postfix
>implementation, and they have their own postgres database.
>
>Is there anything I've missed, or am way off on?  Thanks.

Usually I tar up and move and untar /etc /usr/local /home and possibly /var 
depending on what you have there.

You don't need to disconnect the old box, you can just swap the ip's if you 
want between the boxes so both are still on your netowrk.  Swapping ip's 
requires a different /etc/rc.conf file and a hosts file that reflects the 
current ip and hostname.  This is easily done creating a second 
/etc/rc.conf file say /etc/rc.conf.new edit this file.  Do the same with 
/etc/hosts to /etc/hosts.new  To swap the ip's create a shell script such as:
=====================================
#!/bin/sh

/bin/mv /etc/rc.conf /etc/rc.conf.old
/bin/mv /etc/rc.conf.new /etc/rc.conf
/bin/mv /etc/hosts /etc/hosts.old
/bin/mv /etc/hosts.new /etc/hosts
/sbin/reboot
=====================================
Assuming you run this on both machines with the correctly edited files, 
each will reboot to the other's old IP.

That way if you need to copy things, you still can do so easily.

If you move filesystems between servers run mergemaster once you are done 
to see if you have any out of date or missing files as you are moving from 
5.x to 6.x.

         -Derek

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.



More information about the freebsd-questions mailing list