[Samba] Backup of Samba Server files

Tomasz Chmielewski mangoo at wpkg.org
Mon Sep 17 21:15:52 GMT 2007


Ryan Novosielski schrieb:

>>> But, what about Samba? Should I just backup my /var/lib/samba/* files and
>>> everything would be fine in the case of a new Samba in a new machine?
>>> What
>>> about the SID? In a different machine it is going to be different
>>> isn't it?
>>> Just a net setlocalsid OLDSIDNUMBER would be enough?
>> Realistically, just how big is your server (I mean, the amount of data
>> it stores - /bin, /usr etc., everything)?
>>
>> 1 GB? 2 GB? That's nothing.
>> Perhaps dozens of GBs if you keep some extra data like user profiles for
>> 400 users - but then, you surely make a backup of that, anyway.
>>
>> Just backup everything, it's easiest.
> 
> He has a valid point though... let's say that he wants to just move
> Samba from this server to that server -- maybe separating applications
> on a box, or... who knows what else... He wants to make sure he can just
> do some sort of cutover and it will work; in that case, one DOES need to
> make sure they know what files are necessary. The one that contains the
> domain SID is very important (or at least, knowing what your domain SID
> is before a move)... but I think this stuff is all covered in detail in
> the manual. Am I wrong?

Like, moving from one Linux distro to another etc.?

That also should be easy - most places to look for are (may depend on 
how Samba was compiled, though - see "smbd -b"):

/etc/samba/
/var/lib/samba/
/var/cache/samba/
user profiles, logon scripts, printer drivers etc. - defined in smb.conf


The most important files would be (assuming users are stored in LDAP) 
these two:

smb.conf
secrets.tdb


All other .tdb or .dat files are not really needed (yes, they may 
contain printer settings, something cached, but probably, can be skipped 
in most situations - shouldn't make much harm to copy them, though).

-- 
Tomasz Chmielewski
http://wpkg.org


More information about the samba mailing list