Pre-update checks for UCS 5.0-0 aborts warning about a very large Samba TDB database

Situation:

The pre-checks for the update to UCS 5.0 fail, telling you that the Samba SAM database is very large and that this may result in Samba not starting after the update.

Solution:

Download the script migrate-samldb-from-tdb-to-mdb and arrange a maintenance window for the conversion of the Samba SAM database backend from TDB to LMDB. While TDB has a hard limit of 4GB, the LMBD database format can be adjusted to accommodate larger amounts of data. The LMDB database technology is also used by OpenLDAP, so we consider it to be fit for the job. The script will run a samba-tool dbcheck --cross-ncs before and after the migration, which will take the largest time. In case you want to reduce the downtime you could consider performing the dbcheck separately before the migration and start the script with the option migrate-samldb-from-tdb-to-mdb --skip-dbcheck. This is considered to be safe, because the migration treats all the data as opaque blobs. The dbcheck issues would be on a higher level than where the script operates. Please note that the script needs to be run on all UCS Samba/AD DCs individually, as it’s really just about the local backend storage technology.