[lug] best way to move samba shares to a new server

David L. Willson DLWillson at TheGeek.NU
Mon Jan 2 14:46:09 MST 2012


Brian, 

You never really got more than a few words from anyone, so I'll try to create a complete, if insufficiently detailed, answer to your question.

You will need to do the following:

0. Copy the share definitions:

    You might try copying /etc/samba/ from old-server to new-server.
    If that's not good enough, you might try copying /var/lib/samba/ too.

1. Copy the samba users and groups:

    You might not need to do anything, but you probably will. You might try copying /var/lib/samba/ from the old-server to new-server.
    If that doesn't work, or you prefer to do it manually, running various "net" commands like "net rpc user" on old-server will help you discover the information you need to re-create.

2. Copy the unix users and groups:

    You may choose to copy the relevant lines from /etc/passwd, /etc/shadow, and /etc/group from old-server into the matching files on new-server.

3. Copy the files:

    As has been mentioned, rsync is your friend. You'll want to rsync the home-folders of the affected users, and directories referenced in the path parameter of any share definition from old-server to new-server, maintaining path-names, ownerhsip, and permissions, at least. My favorite rsync switches are avHP.

4. Install, start, and enable the samba daemon:

    "sudo apt-get update && sudo apt-get -y install samba" might do it on debian/ubuntu/*.
    "yum install samba && service samba start && chkconfig samba on" might do it on fedora/redhat/*.

David L. Willson
Trainer, Engineer, Enthusiast
RHCE MCT MCSE Network+ A+ Linux+ LPIC-1 NovellCLA UbuntuCP
tel://720.333.LANS
Freedom is better when you earn it. Learn Linux.



More information about the LUG mailing list