Aaron Reimann
2005-Mar-18 14:32 UTC
[Samba] Migrating Samba and Users to another Fedora 3 box
Hi... I am planning on going from a 36-gig Raid-1 box to an 250-gig Raid-1 (ide) box. The current server is Fedora Core 3 and the new one will also be Fedora Core 3. This box is only used for Samba (file sharing and printer sharing). The system works great, I just need more space. So, could someone please help me out with moving user info and /home directory to the new box? Here are some of the things I am assuming I will need to keep me from recreating users and what not: /etc/passwd - for system users /etc/samba/smb.conf - my config /etc/samba/smbusers - samba user info /home - all user dirs and public shares are in here Is that it? Also, this might be the wrong place for this, but...I can't do a tar.gz of the home directory due to the fact that the drive is almost full. I need to make a tar.gz put | it to the new box via scp. I have seen it done before, can anyone point me in the right direction for a how-to? Thank you, aaron
Adam Williams
2005-Mar-18 14:53 UTC
[Samba] Migrating Samba and Users to another Fedora 3 box
You will also need /etc/shadow for the shadow passwords. I would copy over /etc/passwd and /etc/shadow first so the user accounts are there. Then you can either use rsync (a variation of rsync -avz -e ssh --progress old_server_ip:/home /home may work on the new server) or you can go to /home and du -shc *|grep G and see who has the largest home dirs (you may need grep M instead of G) and then scp -arR /home/user new_Server_ip:/home and then chown -R username /home/username on the new server for a few of the largest home dirs, and then delete them from the old server to give you some space, and then tar -jcvf users.tar.bz2 /home/* and then scp it over to /home on the new server and extract it. Aaron Reimann wrote:>Hi... > >I am planning on going from a 36-gig Raid-1 box to an 250-gig Raid-1 >(ide) box. The current server is Fedora Core 3 and the new one will >also be Fedora Core 3. This box is only used for Samba (file sharing >and printer sharing). The system works great, I just need more space. > >So, could someone please help me out with moving user info and /home >directory to the new box? Here are some of the things I am assuming I >will need to keep me from recreating users and what not: > >/etc/passwd - for system users >/etc/samba/smb.conf - my config >/etc/samba/smbusers - samba user info >/home - all user dirs and public shares are in here > >Is that it? > >Also, this might be the wrong place for this, but...I can't do a >tar.gz of the home directory due to the fact that the drive is almost >full. I need to make a tar.gz put | it to the new box via scp. I >have seen it done before, can anyone point me in the right direction >for a how-to? > >Thank you, >aaron > >
Paul Gienger
2005-Mar-18 14:57 UTC
[Samba] Migrating Samba and Users to another Fedora 3 box
>So, could someone please help me out with moving user info and /home >directory to the new box? Here are some of the things I am assuming I >will need to keep me from recreating users and what not: > >/etc/passwd - for system users >/etc/samba/smb.conf - my config >/etc/samba/smbusers - samba user info >/home - all user dirs and public shares are in here > >Is that it? > >Are you running a domain? If so you'll want to grab most/all the .tdb files from the /var/lib/samba (I think) directory at a minimum.>Also, this might be the wrong place for this, >Just barely ;)>but...I can't do a >tar.gz of the home directory due to the fact that the drive is almost >full. I need to make a tar.gz put | it to the new box via scp. I >have seen it done before, can anyone point me in the right direction >for a how-to? > >Well, tar will keep your permissions, so just doing a straight up scp is out. The easiest way *I* would do it would be using nfs and tar like so... I believe you would need to have your home directory(s) provisioned in such a way that you could export the parent over nfs. In my setup, I have /export/home and then user's home directories are automounted out of that, so if I were doing it, I would do the following: 1. Mount /export on the new box to like /mnt/tmp or something. 2. Move to the container on the new box that will hold the home dirs (would probably /export again in my world , but we'll call it /newExport for clarity) 3. Run this command from /newExport: tar -cf - -C /mnt/tmp home | tar -xvf - Now the explanation of that command: tar - we all know what that does -cf - create an archive on a named file, in this case the file is - - - special argument that is stdout (i believe) -C move to the named directory (/mnt/tmp) before doing anything. This gets rid of the /mnt/tmp that would be prepended to all the file paths in the archive if we were doing something like tar -cf somefilie.tar /mnt/tmp/home /mnt/tmp - dir to move to home - directory inside of /mnt/tmp to tar up | - pipe stdout (remember that - argument?) to the next command, tar tar - no explanation -xvf - extract, with verbose output the named file (-) - - file to extract, in this case it's stdin -- Paul Gienger Office: 701-281-1884 Applied Engineering Inc. Systems Architect Fax: 701-281-1322 URL: www.ae-solutions.com mailto: pgienger@ae-solutions.com
Hmm your forgetting a few things.. sure you've got the usernames and all, what about the *.tdb files.!! best thing is to copy the entire samba dir as well (/usr/local/samba/*) and all posix user files, only passwd isn't enough, coz you'l lose your groups.. you didn't tell us if it's an pdc or not.. or how you're going to do the migration.. ect ect.. L8r COllen Aaron Reimann wrote:> Hi... > > I am planning on going from a 36-gig Raid-1 box to an 250-gig Raid-1 > (ide) box. The current server is Fedora Core 3 and the new one will > also be Fedora Core 3. This box is only used for Samba (file sharing > and printer sharing). The system works great, I just need more space. > > So, could someone please help me out with moving user info and /home > directory to the new box? Here are some of the things I am assuming I > will need to keep me from recreating users and what not: > > /etc/passwd - for system users > /etc/samba/smb.conf - my config > /etc/samba/smbusers - samba user info > /home - all user dirs and public shares are in here > > Is that it? > > Also, this might be the wrong place for this, but...I can't do a > tar.gz of the home directory due to the fact that the drive is almost > full. I need to make a tar.gz put | it to the new box via scp. I > have seen it done before, can anyone point me in the right direction > for a how-to? > > Thank you, > aaron