lawk
May 14, 2026, 2:15pm
1
SYSTEM INFORMATION
OS type and version
Almalinux 9.7
Webmin version
2.641
Virtualmin version
8.1.0 Pro
Webserver version
Apache 2.4.62
Related packages
Postfix3-lmdb, Postfix 3.11.2
I want to switch to lmdb in postfix as Berkeley DB is being deprecated.
I know Virtualmin can handle lmdb by default on alma 10 and derivatives but I was wondering if it can do it on my alma 9.7 install.
Ai suggest the following:
Why not upgrade to Almalinux 10? Just don’t restore anything related to email and check any forwarding that might be on your system.
lawk
May 14, 2026, 4:08pm
3
Alma 10 also has outdated postfix, 3.8. I use 3.11.2 from an external repo for TLS Reporting.
I can update these things like php, mariadb for quite a while without upgrading the OS.
I would only do a new install for new OS.
9.7 also now has Quantum cryptography in its policy to enable, I think 9.7 is still good.
Joe
May 14, 2026, 7:07pm
4
Virtualmin/Webmin doesn’t care. It uses the tools provided by Postfix for interacting with the databases (e.g. postmap). Virtualmin does not interact directly with the db files in any circumstance.
lawk
May 15, 2026, 9:09pm
6
I migrated using a script like this, worked great:
#!/bin/bash
# =============================================
# Generic & Robust Postfix hash → lmdb Migration
# Handles any number of hash: maps automatically
# =============================================
set -e
echo "=== Postfix hash → lmdb Migration (Robust Generic Version) ==="
# 1. Backup
echo "Backing up main.cf..."
cp /etc/postfix/main.cf /etc/postfix/main.cf.hash-backup-$(date +%Y%m%d-%H%M%S)
# 2. Set default type
echo "Setting default_database_type = lmdb"
postconf -e "default_database_type = lmdb"
postconf -e "default_cache_db_type = lmdb"
# 3. Convert ALL hash: to lmdb:
echo "Converting all hash: to lmdb: in main.cf..."
sed -i 's/hash:/lmdb:/g' /etc/postfix/main.cf
# 4. Rebuild maps intelligently
echo "Rebuilding all LMDB maps..."
# Rebuild standard alias map
postalias lmdb:/etc/aliases 2>/dev/null || true
# Find and rebuild all other maps from main.cf
echo "Detecting and rebuilding maps from main.cf..."
# Get all map paths that use lmdb: now
MAPS=$(postconf -n | grep -E '^[a-z_]+_maps' | grep -o 'lmdb:[^, ]\+' | sort -u)
for map in $MAPS; do
# Remove "lmdb:" prefix
path="${map#lmdb:}"
if [ -f "$path" ] || [ -f "$path.db" ]; then
echo "Rebuilding: $map"
# Special case for tls_server_sni_maps (needs -F)
if [[ "$map" == *sni_map* ]] || [[ "$path" == *sni_map* ]]; then
echo " → Using -F flag for SNI map"
postmap -F lmdb:"$path"
else
postmap lmdb:"$path"
fi
else
echo " → Skipping (file not found): $path"
fi
done
# 5. Reload
echo "Reloading Postfix..."
systemctl reload postfix
echo ""
echo "=== Migration completed ==="
# Final info
echo ""
echo "Summary:"
postconf -n | grep -E 'default_database_type|compatibility_level'
echo ""
echo "All active LMDB maps:"
postconf -n | grep -o 'lmdb:[^, ]\+' | sort -u
echo ""
echo "✅ Done! The script automatically detected and rebuilt all maps."
echo "You can run this same script on other servers without modification."