Problem: it is not possible to install a samba 4 domaincontroller into a samba 3 environment

Problem: samba4 joinscript is failing with:

It is not possible to install a samba 4 domaincontroller into a samba 3 environment.

RUNNING 96univention-samba4.inst
2025-06-25 08:44:41.587043236+02:00 (in joinscript_init)
ERROR: It is not possible to install a samba 4 domaincontroller
into a samba 3 environment.
EXITCODE=1
dd2293ff-1616-468d-a49e-de46875498db
RUNNING 97univention-s4-connector.inst
2025-06-25 08:44:42.221540813+02:00 (in joinscript_init)
25.06.25 08:44:42.684 DEBUG_INIT
25.06.25 08:44:42.698 DEBUG_EXIT
ERROR: samba4/ldap/base is empty (most likely the
univention-samba4 join script has not been executed).
Stopping at this point because samba4/ldap/base is the
default for connector/s4/ldap/base and without this the
s4-connector can not work properly.
EXITCODE=1

Investigation:

The joinscript checks the service entry on all DCs:

univention-ldapsearch '(&(univentionService=Samba 3)(objectClass=univentionDomainController))' -LLL dn univentionService

and also checks for this ucr variable:

ucr get samba4/ignore/mixsetup
yes

Solution:

When you know Samba 3 is not used anymore and the migration was done long time before, or you need a new Backup to be joined for Backup2Master you can remove this service entry from the server. An easy way to this is:

. /usr/share/univention-lib/all.sh; ucs_removeServiceFromLocalhost 'Samba 3'

FYI: The leading . (dot) followed by a space is a shell built-in command that sources a script into the current shell environment. This means all functions and variables defined in /usr/share/univention-lib/all.sh become immediately available for use in the current script.

You also have to check the ucr variable samba4/ignore/mixsetup and unset it, if it set to true.
ucr unset samba4/ignore/mixsetup