"samba-tool domain backup restore" fails if there exists a subdomain. This is how the restore command ends: Removing Sysvol reference: CN=WINSRV221,CN=Topology,CN=Domain System Volume,CN=DFSR-GlobalSettings,CN=System,DC=windom1,DC=site Removing nTDSDSA: CN=NTDS Settings,CN=WINSRV224,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=windom1,DC=site (and any children) ERROR(ldb): uncaught exception - No such Base DN: CN=WINSRV224,OU=Domain Controllers,DC=winsubdom11,DC=windom1,DC=site File "/usr/lib/python3/dist-packages/samba/netcmd/__init__.py", line 279, in _run return self.run(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/samba/netcmd/domain/backup.py", line 652, in run remove_dc(samdb, logger, cn) File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 447, in remove_dc offline_remove_ntds_dc(samdb, logger, File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 374, in offline_remove_ntds_dc offline_remove_server(samdb, logger, server_dn, File "/usr/lib/python3/dist-packages/samba/remove_dc.py", line 258, in offline_remove_server computer_msgs = samdb.search(base=computer_dn, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A transaction is still active in ldb context [0x23fc2c0] on /var/lib/samba-tmp/private/sam.ldb