You are not logged in.
Hello,
after a pacman -Suy, I had a problem with my LDAP server. I had the following message in /var/log/everything.log :
Mar 29 15:45:22 frcls0509 slapd[18273]: bdb(o=telcoo,dc=com): Program version 4.5 doesn't match environment version 4.4
The problem is Berkeley DB had been upgraded, and old format isn't recognized anymore. I found a way to upgrade it, but I'd rather warn you : it's not a very clean method
First, I downgraded to db-4.4. For this, you have to cross your finger, and hope you didn't run pacman -Sc or pacman -Scc recently :
cd /var/cache/pacman/pkg
pacman --nodeps --force -U db-4.4.20-3.pkg.tar.gz
Then I can dump my database (I will work on a copy) :
cd /var/lib/openldap
cp -rp data data.old
cd data.old
for i in `ls *.bdb`; do db_dump -f $i.dump -h /var/lib/openldap/data.old/ $i; done
I can know upgrade to db-4.5
pacman -U db
Then I can create a new database and reload my data from dump files :
cd /var/lib/openldap/data
rm -f *
cd /var/lib/openldap/data.old/
for i in `ls *.dump | sed 's/.dump$//'`; do db_load -f /var/lib/openldap/data.old/$i.dump -h /var/lib/openldap/data/ /var/lib/openldap/data/$i; done
Well, now it works, but I was wondering ... what was the good way to do it ? How could have I prevented it ? Help is welcome
Offline
hmm, I think your upgrade for openldap was a bit too much work
cd /var/lib/openldap/data
db_upgrade
would have worked usually
This would be 100% working:
/etc/rc.d/openldap stop
slapcat -l /root/ldif
pacman -S openldap
rm /var/lib/openldap/data/* (though you could keep a backup of DB_CONFIG)
slapadd -l /root/ldif
/etc/rc.d/openldap start
Offline
Well, I forgot to say I tried the db_upgrade after running pacman -Suy, and got the same answer :
"Program version 4.5 doesn't match environment version 4.4" (which is strange, if db_upgrade can't read old versions, how can I upgrade ?!)
I also tried with db_upgrade after downgrading, but as I thought, it didn't work (how could db_upgrade know to which version I will upgrade, and how could it use a posterior version format ?).
I didn't tried slapcat, but if slapd can't open the database because bdb can't read db files, would slapcat work ? And after the downgrade, slapd wouldn't run because the new version required db-4.5, so I think it would be the same for slapcat, wouldn't it ?
Offline
Old slapcat combined with old DB would read it out fine, after that you could upgrade openldap and restore the database from ldif.
Offline