Project

General

Profile

Bug #5575

Updated by Jonathan CLARKE over 9 years ago

When an upgrade of Rudder is done after a major OS upgrade (that changes BerkeleyDB to a superior version), slapd refuses to do anything and breaks the update as the database is made for a previous version. 

 It especially happens during an upgrade from Ubuntu 12.04 to 14.04, like this: 
 * Immediately after the upgrade, BDB switches from 5.1.25 to 5.1.29, making the old slapd from 12.04 unable to do anything 
 * It makes rudder-inventory-ldap unable to upgrade properly (can't run post/pre in/uninstall scripts) => dead end 
 * When forced to upgrade anyway, the expected BDB version bumps to 5.1 to 5.3, making a database export/reimport mandatory 

 *WORKAROUND*: 
 * Upgrade to the latest Rudder version 
 * Before doing anything, export your current LDAP content: 
 <pre> 
 /opt/rudder/sbin/slapcat -f /opt/rudder/etc/openldap/slapd.conf | gzip > /tmp/database-export.ldif.gz 
 </pre> 
 * kill slapd: 
 <pre> 
 killall -9 slapd 
 </pre> 
 * Replace key elements (called by postinst/preinst scripts) by dummies to make the upgrade OK 
 ** Create dummy.sh 
 <pre> 
 #!/bin/sh 

 exit 0 
 </pre> 
 ** Install it to the right places 
 <pre> 
 cp /etc/init.d/rudder-slapd /etc/init.d/rudder-slapd.orig 
 chmod +x dummy.sh 
 cp dummy.sh /etc/init.d/rudder-slapd 
 cp dummy.sh /opt/rudder/sbin/slapcat 
 cp dummy.sh /opt/rudder/sbin/slapindex 
 </pre> 
 * Upgrade Rudder to your target OS version (in this example, from Ubuntu precise to trusty) 
 * Restore the original init script: 
 <pre> 
 cp /etc/init.d/rudder-slapd.orig /etc/init.d/rudder-slapd 
 </pre> 
 * Import your LDAP backup 
 <pre> 
 cd /var/rudder/ldap/openldap-data/ /opt/rudder/ldap/openldap-data/ 
 mv DB_CONFIG ~ 
 rm -rf * 
 cp ~/DB_CONFIG . 
 zcat /tmp/database-export.ldif.gz | /opt/rudder/sbin/slapadd -q 
 </pre> 
 * Restart slapd 
 <pre> 
 service rudder-slapd restart 
 </pre> 

 You should be OK now :)

Back