[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Can't import ldif file





On 8/12/09 9:50 AM, "Quanah Gibson-Mount" <quanah@zimbra.com> wrote:

> --On Wednesday, August 12, 2009 9:27 AM -0700 Kristen Walker
> <kwalker@sbceo.org> wrote:
> 
>> Hello - apologies if this is a dumb question, I am an LDAP newbie.  I have
>> an LDAP server on another machine and I need to duplicate it, but I am
>> having trouble importing the ldif file.
>> 
>> I do a dump of the LDAP data with this command:
>> 
>> nice slapcat > /home/upadmin/uportal_ldap_backups/`date
>> +%m%d%Y_%H%M`_ldap_backup.ldif
>> 
>> 
>> I move the resulting ldif file to my other server and test the import:
>> 
>> slapadd -v -u -c -f /usr/local/etc/openldap/slapd.conf -l
>> /root/08052009_0647_ldap_backup.ldif
>> 
>> The output seems good - I get:
>> 
>> added: "dc=sbceoportal,dc=org"
>> added: "ou=Users,dc=sbceoportal,dc=org"
>> added: "ou=Groups,dc=sbceoportal,dc=org"
>> added: "ou=System,dc=sbceoportal,dc=org"
>> added: "cn=LDAP Admins,ou=Groups,dc=sbceoportal,dc=org"
>> .#################### 100.00% eta   none elapsed            none fast!
>> 
>> Then I run the command to do the real import:
>> 
>> slapadd -v -f /usr/local/etc/openldap/slapd.conf -l
>> /root/08052009_0647_ldap_backup.ldif
>> 
>> And the import hangs on the first record.  This is the output I get:
>> 
>> bdb_monitor_db_open: monitoring disabled; configure monitor database to
>> enable
>> added: "dc=sbceoportal,dc=org" (00000001)
>> 
>> 
>> And it just seems to sit there and never finish.  Anyone have any idea
>> what is going on or anything I can do to troubleshoot this?
> 
> A couple of things:
> 
> Do you have a DB_CONFIG file?
> 
> Does the progress bar show up?
> 
> Does the server you are adding to already have a database?
> 
> Have you thought about using the "-q" flag to slapadd?
> 
> --Quanah
> 
> --
> 
> Quanah Gibson-Mount
> Principal Software Engineer
> Zimbra, Inc
> --------------------
> Zimbra ::  the leader in open source messaging and collaboration


I have a DB_CONFIG, here are the contents:

**************************************************************************
# $OpenLDAP: pkg/ldap/servers/slapd/DB_CONFIG,v 1.3.2.4 2007/12/18 11:53:27
ghenry Exp $
# Example DB_CONFIG file for use with slapd(8) BDB/HDB databases.
#
# See the Oracle Berkeley DB documentation
#   
<http://www.oracle.com/technology/documentation/berkeley-db/db/ref/env/db_co
nfig.html>
# for detail description of DB_CONFIG syntax and semantics.
#
# Hints can also be found in the OpenLDAP Software FAQ
#       <http://www.openldap.org/faq/index.cgi?file=2>
# in particular:
#   <http://www.openldap.org/faq/index.cgi?file=1075>

# Note: most DB_CONFIG settings will take effect only upon rebuilding
# the DB environment.

# one 0.25 GB cache
set_cachesize 0 268435456 1

# Data Directory
#set_data_dir db

# Transaction Log settings
set_lg_regionmax 262144
set_lg_bsize 2097152
#set_lg_dir logs

# Note: special DB_CONFIG flags are no longer needed for "quick"
# slapadd(8) or slapindex(8) access (see their -q option).
**************************************************************************

I don't see a progress bar when I try the import, it just seems to hang.
The server I am adding to does not have a database.  I do a rm __db.* *.bdb
log.* in the openldap-data directory after the failed imports so that I wipe
out the database each time and start over.

I haven't tried the -q flag and got this:

slapadd -q -v -f /usr/local/etc/openldap/slapd.conf -l
/root/08052009_0647_ldap_backup.ldif
bdb_db_open: database "dc=sbceoportal,dc=org": unclean shutdown detected;
attempting recovery.
bdb(dc=sbceoportal,dc=org): recovery requires transaction support
bdb_db_open: database "dc=sbceoportal,dc=org" cannot be recovered, err 22.
Restore from backup!
backend_startup_one: bi_db_open failed! (22)
slap_startup failed


Thanks!
Kristen

--
Kristen Walker

Digital Media Resources Developer
Instructional Media Services
Santa Barbara County Education Office
4400 Cathedral Oaks Road
P.O. Box 6307
Santa Barbara, CA 93160-6307
(805)964-4711 ext. 5244/FAX (805)683-3597
kwalker@sbceo.org
http://www.sbceoportal.org