Backing up samba4

Rowland Penny repenny at
Wed Sep 19 11:42:27 MDT 2012

On 19/09/12 18:03, Andrew Bartlett wrote:
> On Wed, 2012-09-19 at 15:31 +0100, Rowland Penny wrote:
>> On 19/09/12 14:55, Marc Muehlfeld wrote:
>>> Am 19.09.2012 15:27, schrieb steve:
>>>> I just did it on a test LAN. I deleted /usr/local/samba and rsynced
>>>> it back.
>>>> samba fired up fine. xp and w7 clients could log in and GPO's were
>>>> respected.
>>>> What is the problem in doing this? It works with openSUSE 12.2. It
>>>> fails with
>>>> ubuntu lts.
>>> I guess it worked, because during the rsync, nothing was changed in
>>> the tdb/ldb files, because it's a small test network. If you have a
>>> bigger network, where the databases often changes, it could happen
>>> that this appears during your rsync. Then you have a
>>> corrupt/inconsistent "backup".
>>> I think for the tdb/ldb files tdbdump is a must.
>>> In my backup script I run tdbbackup for all that files to generate the
>>> *.bak of them and then tar the whole to a save place (with ext. ACLs).
>>> So I can copy it back and have a hopefully save backup of the
>>> databases if neccessary.
>>> On Rowlands initial question, how to to restore tdbbackup files:
>>> I haven't tried it yet. But let me know if tdbrestore is the working way.
>>> Regards,
>>> Marc
>> Hi, the one thing about samba 4 you can be sure of, is that you will get
>> confused easily ;-)
>> on one hand:
>> On 19/09/12 12:17, Ricky Nance wrote:
>>   >
>>   >  Yes simply removing the .bak will be sufficient, you can also use
>> tdbrestore.
>>   >
>> on the other hand:
>> Marc posts a link to a previous post that says:
>> Use tdbrestore to restore tdb files.
>> tdbback dbname.tdb>  dbname-backup
>> tdbrestore dbname.tdb<  dbname-backup
>> Is what Ricky Nance wrote correct, can you just remove the .bak? or
>> would it be better to use tdbrestore and if so, are the given commands
>> correct?
> Ricky is correct in this instance.
> tdbbackup creates a second, live and ready-to-use tdb that can then be
> copied because nothing else is using it.  The other command pair you are
> trying to refer to to tdbdump and tdbrestore, which creates a larger
> text file representations of the data, and creates a fresh tdb from that
> text file.  These are really more development tools, but could be useful
> in some very, very low level debugging situations.  This is not needed
> for typical backup/restore.
> In the link provided, Amitay got the tdbbakcup and tdbdump tools
> confused.
> Andrew Bartlett
Thanks Andrew, but I now have one more question, I have a lot of .tdb 
files in /usr/local/samba/var/lock
& /usr/local/samba/var/locks , there are also some wins.* files in the 
locks dir. Do these need backing up?


This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

More information about the samba-technical mailing list