Migrating Samba Server and Users in CentOS 6
To migrate Samba users from one server to another, we will be needing to migrate the following -
IMPORTANT: It is vital to preserve the permissions of the files/directories. Although there are many ways to do this, rsync is the easiest possible way.
NOTE: Shared directories can also be migrated the same as home directories. rsync can take care of it.
New Server:
First, we copy the /root/move directory from the old server to the new server.
IMPORTANT: Please backup you passwd, group and shadow file before the next step.
Then, we merge the *.mig files to the actual passwd, group and shadow files
IMPORTANT: Please make sure to use >> (append) and not > (redirection)
Now, it's time to prepare samba
If samba is up and running, netstat would show it.
This way, a Samba server with all it users can be migrated to a new system. Shutdown the old server and check whether the domain or shared directories can be used.
Hope it helps.
Reference: http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/
- /etc/passwd
- /etc/group
- /etc/shadow
- home directories and shared directories
- /etc/samba
- /var/lib/samba
Old Server:
Backing up users, groups and passwords
NOTE: Please click here for explanation on what the awk command does.
Time to move the home directories using rsync
NOTE: Please click here for explanation on what the awk command does.
Time to move the home directories using rsync
IMPORTANT: It is vital to preserve the permissions of the files/directories. Although there are many ways to do this, rsync is the easiest possible way.
NOTE: Shared directories can also be migrated the same as home directories. rsync can take care of it.
New Server:
First, we copy the /root/move directory from the old server to the new server.
IMPORTANT: Please backup you passwd, group and shadow file before the next step.
Then, we merge the *.mig files to the actual passwd, group and shadow files
IMPORTANT: Please make sure to use >> (append) and not > (redirection)
Now, it's time to prepare samba
If samba is up and running, netstat would show it.
This way, a Samba server with all it users can be migrated to a new system. Shutdown the old server and check whether the domain or shared directories can be used.
Hope it helps.
Reference: http://www.cyberciti.biz/faq/howto-move-migrate-user-accounts-old-to-new-server/
Comments
Post a Comment