LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Migrating Samba from CentOS 6 to 7 (https://www.linuxquestions.org/questions/linux-server-73/migrating-samba-from-centos-6-to-7-a-4175623818/)

cahalsall 02-15-2018 07:07 PM

Migrating Samba from CentOS 6 to 7
 
I have managed to migrate Samba NT Domains using tdbsam backend from CentOS 5 to 6 without any problems. I have not tried to migrate from 6 to 7 yet, but just looking at the changes within the Operating System it seems that the old way of doing it will not work. Have anyone managed to do this successfully?

frankbell 02-16-2018 07:48 PM

I think it would help if you were to provide more information about your network. What exactly to you mean by "Samba NT Domains," for example, as Samba is Linux and NT is Windows?

This will provide some quidelines: https://www.linuxquestions.org/linux...Ask_a_Question

cahalsall 03-27-2018 12:31 AM

Sorry should have been clearer. Samba "NT type Domain" as opposed to Active Directory or LDAP. It was meant to be a general question. With tdbsam the key to migrating a samba servers lie in the /var/lib/samba/private and /etc/samba directories as well as content from the /etc/passwd, /etc/group and /etc/shadow files.

Here is an example of the script I use to backup samba server settings.

Code:


export UGIDLIMIT=500
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/passwd > /root/serverbk/passwd.mig
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534)' /etc/group > /root/serverbk/group.mig
awk -v LIMIT=$UGIDLIMIT -F: '($3>=LIMIT) && ($3!=65534) {print $1}' /etc/passwd | tee - |egrep -f - /etc/shadow > /root/serverbk/shadow.mig
/bin/cp -f /etc/gshadow /root/serverbk/gshadow.mig

/bin/cp -apf /etc/samba /root/serverbk/
/bin/cp -apf /var/lib/samba/private /root/serverbk/
/bin/cp -apf /var/lib/samba/netlogon /root/serverbk/
/usr/bin/net groupmap list > /root/serverbk/groupmap.list
/bin/cp -apf /root/bin /root/serverbk/
/usr/bin/lpstat -v > /root/serverbk/printer.list
/bin/ls -l /sambashares > /root/serverbk/share.list

/usr/bin/crontab -l > /root/serverbk/crontab-root.list
/sbin/runuser -l adminuser -c '/usr/bin/crontab -l'  > /root/serverbk/crontab-adminuser.list

# Optional (can cause some problems, better just backup data without settings and config files)
# tar -zcvpf /root/serverbk/home.tar.gz /home

There is also a restore script.


All times are GMT -5. The time now is 04:34 AM.