LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   how to backup SAMBA files (https://www.linuxquestions.org/questions/suse-opensuse-60/how-to-backup-samba-files-615619/)

linuxlimbo 01-22-2008 08:23 PM

how to backup SAMBA files
 
I am running SUSE 10.2 and have my machine functioning as a Domain Controller. Is there a way to backup the Samba domain info so that if I do a reinstall of Linux, I don't have to play games with the two Windows machines that are joined to the domain. ( ie, remove them from the domain and rejoin them within Windows.) The last time I did this, I had trouble with the profiles on the Windows machines once I rejoined them. It seems like there must be some directories that contain all of the machine and user info that I could backup and then restore later.

rabbit2345 01-22-2008 08:30 PM

copy all of the /etc/samba files and that should save your configuration. Most of your configuration files are in the /etc directory

you can use the command:

cp /etc/samba/* /<path to backup site>/

gilead 01-22-2008 09:53 PM

Also, to get sub-directories you could use:
Code:

cp -av /etc/samba /path/to/backup
Or you could tar/compress the data with:
Code:

tar -cjvf /path/to/backup/samba.tar.bz2 -C /etc samba

furb-dizzle 07-15-2008 01:28 PM

Not just configuration, more help, please... :-)
 
Limbo: I am looking for the same thing.

Obviously the config files for samba are needed, then you also need the /etc/passwd, /etc/shadow, and /etc/group files so that the unix users exist after recovery.

However, the samba *.tdb files (the database of users/sids/blah blah blah) are also needed. I believe those are in /var/lib/samba for many distributions, and we have done these too.

If that worked, I'd be happy to report, but it doesn't; we just did a server replacement because our server died (a RAM issue that exposed itself during a distribution upgrade - not nice). So we recovered all of the configuration files, and the database files, but still had to rejoin all of the workstations to the new server with the same existing domain. I tried adding the machine accounts to the server (smbpasswd -m machinename$) but that still didn't work. I even had to add all of the users to the samba server using pdbedit -a -u user. The user and machine accounts were in unix, because I had the /etc/passwd, group, and shadow files transferred, but they were not in the pdbedit -L list. So, I think we need an alternate backup utility but I have scoured the Internet and have come up short. I saw a reference to a tdbbackup utility, but need to search further.

If I come up with something, I'll let you know, and if you could do the same it would be much appreciated. This is an issue that has plagued us several times as we have had offices with 20 workstations and had to rejoin them all. Sometimes, we've had to build all of the employees' profiles from scratch because their sids were screwed up. That makes for a long weekend, and there's just got to be a better way!

Thanks in advance,

Furb-dizzle

AndreAPL 10-17-2009 03:18 PM

Quote:

Originally Posted by furb-dizzle (Post 3215473)
Limbo: I am looking for the same thing.

Obviously the config files for samba are needed, then you also need the /etc/passwd, /etc/shadow, and /etc/group files so that the unix users exist after recovery.

However, the samba *.tdb files (the database of users/sids/blah blah blah) are also needed. I believe those are in /var/lib/samba for many distributions, and we have done these too.

If that worked, I'd be happy to report, but it doesn't; we just did a server replacement because our server died (a RAM issue that exposed itself during a distribution upgrade - not nice). So we recovered all of the configuration files, and the database files, but still had to rejoin all of the workstations to the new server with the same existing domain. I tried adding the machine accounts to the server (smbpasswd -m machinename$) but that still didn't work. I even had to add all of the users to the samba server using pdbedit -a -u user. The user and machine accounts were in unix, because I had the /etc/passwd, group, and shadow files transferred, but they were not in the pdbedit -L list. So, I think we need an alternate backup utility but I have scoured the Internet and have come up short. I saw a reference to a tdbbackup utility, but need to search further.

If I come up with something, I'll let you know, and if you could do the same it would be much appreciated. This is an issue that has plagued us several times as we have had offices with 20 workstations and had to rejoin them all. Sometimes, we've had to build all of the employees' profiles from scratch because their sids were screwed up. That makes for a long weekend, and there's just got to be a better way!

Thanks in advance,

Furb-dizzle

Sorry the digging.
Any news?

furb-dizzle 10-19-2009 12:08 PM

Quote:

Originally Posted by AndreAPL (Post 3723039)
Sorry the digging.
Any news?

I sort of gave up after searching for a bit. I think it has to do with the SID of the server, but I'm not sure. If you could change the new server's SID to be the same as the old one, and copy all of the database configuration files over, it seems like you could do it. I am not sure; it doesn't come up all that often for us, so I just do it by hand. It is a drag, though when it happens.


All times are GMT -5. The time now is 08:59 AM.