A customer has reported that they cannot create backups after migrating their idmap backend to mdb [1]: root@primary0:~# /usr/sbin/univention-samba4-backup --days 15 Failed to open ./private/sam.ldb.d/CN=SCHEMA,CN=CONFIGURATION,DC=EXAMPLE,DC=COM.ldb Error while backing up ./private/sam.ldb.d/CN=SCHEMA,CN=CONFIGURATION,DC=EXAMPLE,DC=COM.ld with tdbbackup - status 1 It is known that tdbbackup cannot create backups with mdb files. An alternative is to use mdb_copy. This costumer was kind enough to provide a patch for a workaround to this problem: --- /usr/sbin/univention-samba4-backup 2022-11-21 10:23:01.000000000 +0100 +++ univention-samba4-backup 2022-12-27 14:06:25.388375524 +0100 @@ -129,7 +129,7 @@ cd $FROMWHERE for d in $DIRS; do - relativedirname=`find . -type d -name "$d" -prune` + relativedirname=`find . -maxdepth 1 -type d -name "$d" -prune` # IMPORTANT: added -maxdepth 1 to avoid getting other dirs called "private" further down the tree, e.g. deep in the sysvol dir n=`echo $d | sed 's/\//_/g'` if [ "$d" = "private" ]; then for db in tdb ldb; do @@ -143,7 +143,12 @@ tdbbackup $file Status=$? if [ $Status -ne 0 ]; then - terminate_on_error "Error while backing up $file with tdbbackup - status $Status" + echo "Error while backing up $file with tdbbackup - status $Status - will try mdb_copy in case MDB format is used" >&2 + mdb_copy -c -n $file > $file.bak + Status=$? + if [ $Status -ne 0 ]; then + terminate_on_error "Error while backing up $file with mdb_copy - status $Status" + fi fi fi done [1] https://help.univention.com/t/pre-update-checks-for-ucs-5-0-0-aborts-warning-about-a-very-large-samba-tdb-database/18014
Please attach the patch as a file so that devs can download and apply it.
Created attachment 11020 [details] Patch to fix bug.
Any updates? The support ticket is still waiting for a fix.
Should be fixed by the erratum for Bug #56434. That change adjusted univention-samba4-backup to use "samba-tool domain backup offline" instead of our code. *** This bug has been marked as a duplicate of bug 56434 ***