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.