Results 1 to 5 of 5

Thread: Export ldap to ldif in Zimbra 6

  1. #1
    openlog is offline Starter Member
    Join Date
    Jan 2012
    Posts
    1
    Rep Power
    3

    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 ?

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,480
    Rep Power
    56

    Default

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


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    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.

  4. #4
    sjangra's Avatar
    sjangra is offline Intermediate Member
    Join Date
    May 2011
    Posts
    24
    Rep Power
    4

    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

  5. #5
    LaFong is offline Advanced Member
    Join Date
    Nov 2008
    Location
    Denver, CO
    Posts
    221
    Rep Power
    6

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Mysql.server Does Not Start
    By carnold in forum Administrators
    Replies: 7
    Last Post: 01-16-2012, 07:13 AM
  2. Replies: 31
    Last Post: 12-15-2007, 09:05 PM
  3. Zimbra shutdowns every n hours.
    By Andrewb in forum Administrators
    Replies: 13
    Last Post: 08-14-2007, 08:55 AM
  4. Can't start Zimbra!
    By zibra in forum Administrators
    Replies: 5
    Last Post: 03-22-2007, 11:34 AM
  5. Replies: 16
    Last Post: 01-05-2006, 09:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •