[Samba] safe to replace just one ldb file?

Rowland Penny rowlandpenny at googlemail.com
Tue Sep 2 08:30:52 MDT 2014

On 02/09/14 14:54, mourik jan heupink - merit wrote:
> On 9/2/2014 14:27, mourik jan heupink - merit wrote:
>> Hi Rowland,
>> On 9/2/2014 14:15, Rowland Penny wrote:
>>> How did you remove the deleted objects, did you edit the .ldb files in
>>> the sam.ldb.d directory ? If so, then you could have damaged your AD,
>>> you shouldn't edit these directly.
>> With many lines like:
>>   ldbdel -d 0 -H sam.ldb "<GUID=66fd6cd4-a9dc-4d05-ab0c-dc915fce6adb>"
>> --show-recycled --relax
> The script was provided by sernet, so I guess it should be safe...
> The question that remains is:
> Can I just
> - shutdown samba
> - tdbbackup DC=DOMAINDNSZONES,DC=...ldb
> - replace DC=DOMAINDNSZONES,DC=...ldb with the smaller .bak file
> - start samba again
> or do I need to make a dump/restore for *all* ldb files to keep 
> everything in sync?
> MJ

OK, now that it is confirmed that you haven't done anything to damage 
your AD ;-)

There is one problem that I can see, 'tdbbackup' is for backing up .tdb 
files not .ldb files, the name sort of gives it away ;-)

I think that you will need to backup everything, see: 

Only possible problem is, if sernet-samba is like the debian samba4 
packages, the backup script is not installed, if so just down the latest 
samba4 tarball, unpack it and extract the script from there.


More information about the samba mailing list