Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-12-2012, 02:47 AM
Starter Member
 
Posts: 1
Unhappy Export ldap to ldif in Zimbra 6

Hello world !

I'm spending all my time since 2 weeks trying to export my dlap to an ldif file.

I tried to do like this :

# su zimbra
zimbra@mail:/root$ /opt/zimbra/openldap-2.4.23.2z/sbin/slapcat -f /opt/zimbra/openldap-2.4.23.2z/etc/openldap/slapd.conf -l /tmp/ldap.ldif

but it return :

Unrecognized database type (bdb)
/opt/zimbra/openldap-2.4.23.2z/etc/openldap/slapd.conf: line 53: <database> failed init (bdb)
slapcat: bad configuration file!

I supose it's because this method is not more available in zimbra 6.
I really need an ldif export.

Can you help me ?
Reply With Quote
  #2 (permalink)  
Old 01-14-2012, 05:02 AM
Zimbra Consultant & Moderator
 
Posts: 20,314
Default

Perhaps if you gave some details about what you're trying to achieve someone may be able to advise you.
__________________
Regards


Bill
Reply With Quote
  #3 (permalink)  
Old 01-14-2012, 10:18 PM
Advanced Member
 
Posts: 213
Default

For a single user:
Code:
su - zimbra
cd /tmp
source ~/bin/zmshutil ; zmsetvars
ldapsearch -x -H ldap://$ldap_host -D "$zimbra_ldap_userdn" -w "$zimbra_ldap_password" "(mail=user@mydomain.com)" | sed -e '/# search result/,$ d' > user.ldif
Change:

user@mydomain.com to the user for whom you want the ldif
user.ldif to whatever_you_want.ldif

If you want all users in a single ldif, replace the ldapsearch command above with
Code:
 ldapsearch -x -H ldap://$ldap_host -D "$zimbra_ldap_userdn" -w  "$zimbra_ldap_password" | sed -e '/# search  result/,$ d' > user.ldif
i.e. remove the "(mail=user@mydomain.com)" filter.
Reply With Quote
  #4 (permalink)  
Old 01-20-2012, 08:26 PM
Intermediate Member
 
Posts: 22
Default

su - zimbra

ldapsearch -x -v -H ldap://zimbra-ldap.example.com -b 'ou=people,dc=domain,dc=com' -D 'uid=zimbra,cn=admins,cn=zimbra' -W

it will ask you password for ldap root dn.

enjoy !!
__________________
Thanks & Regards
S. Jangra
System Admin
Reply With Quote
  #5 (permalink)  
Old 01-20-2012, 09:52 PM
Advanced Member
 
Posts: 213
Default

The advantage of the source & zmsetvars commands...
source ~/bin/zmshutil ; zmsetvars
is that you don't need to remember or look up the ldap root dn or root dn password. The values you need become environment variables.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.