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 -
- /etc/passwd
- /etc/group
- /etc/shadow
- home directories and shared directories
- /etc/samba
- /var/lib/samba
We assume that we have two servers: old-server
(192.168.10.10) and new-server
(192.168.10.20). Some of the commands are need to be run in the old-server and some
need to be run in new-server.
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.
No comments:
Post a Comment