Samba3 to Samba3 Migration IMPORTANT: This method assumes you are migrating between two identical servers (from a software perspective). Specifically, they must both use a 3.x version of Samba and they will end up as a PDC of the same domain and have the same hostname. 1) Capture several files from the existing PDC. 1. /etc/passwd 2. /etc/group 3. /etc/shadow 4. /etc/samba/smbpasswd 5. /etc/samba/secrets.tdb 6. /var/named/{forward zone file} (optional) 7. /var/named/{reverse zone files} (optional) 8. /var/lib/dhcp/dhcpd.leases (optional) 2)Build the new server. 1.Run the PDC config script to set up as a PDC in the normal manner. 2.Be sure to set the hostname & domain to be the same as the existing PDC. 3.Manually change the ip address to something that does not conflict with the existing PDC (eg. 'ifconfig eth0 10.xx.16.3 netmask 255.255.255.0 up'). 3)Modify /etc/group on the NEW server. 1.Copy all entries with a group number of 501 or greater from the original group file to the new group file. You should have the usersync user already at user 500 on both systems. IF THIS IS NOT THE CASE there will be some manual intervention needed to ensure all users have a unique group ID and that their respective homes are using the proper group ID. Also copy and/or replace any system level groups (adm,wheel,users,staff,teachers) on the new server with their counterparts from the old server. 2.If the two servers are truly identical down to the last detail (except for newer hardware or something) you should be able to just copy the old /etc/group to the new server. You can verify this by running 'diff /old/etc/group /new/etc/group'. The only differences you should see are those related to building users with accounts higher than 500 and system related entries (like wheel, adm, staff etc.) where users have been added to system groups. 4)Modify /etc/passwd on the NEW server. 1.The same basic rules apply here as in /etc/group above except that you only deal with additions (id 501 and above) and not change any preexisting entries. 2.If the servers are identical it is easier to just replace the file on the new server with the one from the old server. 5)Modify /etc/shadow on the NEW server. 1.This file should NOT be copied verbatim between the servers. Although you will find they look very similar some of the numbers involved will be slightly different. I'm being cautious here in not copying the file. I don't want to end up with subtle errors and problems because of a hacked shadow file. This is an important security file. 2.Run 'diff /old/etc/shadow /new/etc/shadow' to identify differences between the two files. What results should only be users that have been added subsequent to the server build and should only have user id's greater than 500 (with 500 being for usersync). 3.Edit the two files and copy the user information identified above from the old file to the new file (vi works great for this). 6)Copy /etc/samba/smbpasswd to the new server. 1.Just copy verbatim - no adjustments needed. 7)Copy /etc/samba/secrets.tdb to the new server. 1.Just copy verbatim - no adjustments needed. ***Copy Data to new server*** 1)Setup NFS on the NEW server. 1.Add to /etc/exports 1./home 10.xx.16.2(sync,rw,no_root_squash) 2./opt 10.xx.16.2(sync,rw,no_root_squash) 2.Start all nfs related services on the NEW server. This should include portmap, nfslock, and nfs at minimum. If the nfs service is started prior to populating /etc/exports you will need to run 'exportfs -ra' before your changes will take effect. 2)On the OLD server mount the nfs shares and copy the data. 1.mkdir /mnt/tmp (on OLD server to serve as a mount point for the nfs shares on the NEW server (you'll only do this once). 2.mount 10.xx.16.3:/opt /mnt/tmp 3.cd /opt 4.cp -af * /mnt/tmp 5.umount /mnt/tmp 6.mount 10.xx.16.3:/home /mnt/tmp 7.cd /home 8.cp -af * /mnt/tmp 9.umount /mnt/tmp 3)Turn off nfs service on NEW server. 4)Shutdown the old server. 5)Reboot the new server. Make sure all relevant services are set to start at boot (smb, dhcpd, named etc).