You are not logged in.

#1 2009-11-05 12:19:26

wazow
Member
From: Europe
Registered: 2008-11-11
Posts: 39

Migrating openldap database

I use openldap to manage my email addressbook.  Recently (few weeks ago) there was an upgrade in stable, either of berkeley DB or of openldap, or of both.  Ever since slapd fails to start with the following error message (just a suffix quoted here, the error line is in bold):

slapd startup: initiated.
backend_startup_one: starting "cn=config"
config_back_db_open
backend_startup_one: starting "o=wasowski.org"
bdb_db_open: database "o=wasowski.org": dbenv_open(/home/openldap/openldap-data).
bdb(o=wasowski.org): Program version 4.8 doesn't match environment version 4.7
bdb_db_open: database "o=wasowski.org" cannot be opened, err -30971. Restore from backup!
====> bdb_cache_release_all
bdb(o=wasowski.org): txn_checkpoint interface requires an environment configured for the transaction subsystem
bdb_db_close: database "o=wasowski.org": txn_checkpoint failed: Invalid argument (22).
backend_startup_one (type=bdb, suffix="o=wasowski.org"): bi_db_open failed! (-30971)
slapd shutdown: initiated
====> bdb_cache_release_all
bdb_db_close: database "o=wasowski.org": alock_close failed
slapd destroy: freeing system resources.
slapd stopped.

How should I upgrade my database to the new format? I want my email address book buuu ...

I appreciate any help.

Offline

#2 2009-11-05 17:39:51

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 690
Website

Re: Migrating openldap database

Below is the message that the db package prints on upgrade. Now, you only need to find where openldap keeps its databases and run db_upgrade on them. Make backups first, of course. tongue

(Have a look at this thread and this page as well.)

ATTENTION DB PACKAGE:
Please consider to run db_upgrade on Berkeley DB databases with a major db version number update.

Offline

#3 2009-11-05 21:31:16

wazow
Member
From: Europe
Registered: 2008-11-11
Posts: 39

Re: Migrating openldap database

Thank you foutrelis.  I try the following:

[root@piwniczna openldap-data]# db_upgrade cn.bdb 
db_upgrade: Program version 4.8 doesn't match environment version 4.7
db_upgrade: DB_ENV->open: DB_VERSION_MISMATCH: Database environment version mismatch

And ? Does not take me very far.  db_upgrade seems to have the same complaint sad

Offline

#4 2009-11-05 22:01:16

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 690
Website

Re: Migrating openldap database

Does this help?

Offline

#5 2009-11-05 22:53:18

wazow
Member
From: Europe
Registered: 2008-11-11
Posts: 39

Re: Migrating openldap database

foutrelis that was amazing.  It works! works! works! I am grateful! grateful! grateful!!!

PS.  for the record I downgraded my db to

pacman -fd -U db-4.7.25.4-1-i686.pkg.tar.gz

(I luckily had the tar.gz file in /var/cache/pacman/pkg).

Then I just went to directory with the database and run

db_checkpoint -1
db_recover

Then I upgraded db back to version 4.8, and run db_recover -e in the database directory.

And it works!!!

Last edited by wazow (2009-11-05 22:56:28)

Offline

Board footer

Powered by FluxBB