OpenLDAP MigrationTools

| |
[不指定 2008/10/05 19:30 | by ipaddr ]

The MigrationTools are a set of Perl scripts for migrating users, groups, aliases, hosts, netgroups, networks, protocols, RPCs, and services from existing nameservices (flat files, NIS, and NetInfo) to LDAP.

The tools require the ldapadd and ldif2dbm commands, which are distributed with most LDAP servers derived from the University of Michigan LDAP distribution. The source code for these is available with OpenLDAP. Additionally, Netscape provide an implementation of ldapmodify which subsumes the functionality of ldapadd. If you are using Netscape's Directory Server, you should set the $NSHOME and $serverId environment variables to assist the MigrationTools in locating your LDAP database and LDIF tools; they will use ldapmodify instead of ldapadd.  

These tools are freely redistributable according to the license included with the source files. They may be bundled with NIS/LDAP migration products. See RFC 2307 for more information on the schema used by these scripts. THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY AND WITHOUT SUPPORT.


  • creates naming context entries, including subordinate contexts such as ou=people and ou=devices.  
  • migrates aliases in /etc/aliases to entries conforming to the rfc822MailGroup schema. Organizations who have deployed LDAP-based messaging solutions, such as Netscape's Messaging Server, may wish to use a different schema for representing mail aliases. Ypldapd does not use X.500 groups (such as groupOfUniqueNames) for mail alias expansion because flattening an arbitrarily nested group at runtime may be expensive. (It is possible to write a ypldapd plug-in to support such a schema, however.)
  • migrates groups in /etc/group  
  • migrates hosts in /etc/hosts  
  • migrates networks in /etc/networks  
  • migrates users in /etc/passwd. Note that if users are allowed read the userPassword attribute, and your LDAP server doesn't support authenticating against hashed passwords then anyone may read the userPassword attribute's value and authenticate as that user. Modern LDAP servers, such as Netscape Directory Server, support authenticating against hashed passwords, so this is not an issue. The OpenLDAP LDAP server also supports such authentication.  
  • migrates protocols in /etc/protocols  
  • migrates services in /etc/services  
  • migrates netgroups in /etc/netgroup  
  • migrates the netgroup.byuser map. It requires revnetgroup.  
  • migrates the netgroup.byhost map. It requires revnetgroup.  
  • migrates RPCs in /etc/rpc


The configuration for these Perl scripts is contained at the head of  

Perl variable



The mail domain used for the mail attribute in when extended schema support is enabled. You may override this with the DEFAULT_MAIL_DOMAIN environment variable.


The naming suffix to use in entries' distinguished names. If undefined, this will be constructed by mapping the mail domain name into a distinguished name (eg becomes dc=aceindustry,dc=com). You may override this with the LDAP_BASEDN environment variable.


Enables extended schema support. This adds the organizationalPerson and inetOrgPerson object classes, amongst others, to users migrated by the script.


Determines the LDAP/X.500 naming context to use for a migration tool. The dictionary is keyed by tool (as in Values are concatenated with $DEFAULT_BASE by the &getsuffix() subroutine.

The following environment variables control the behavior of the migration shell scripts:  

Environment variable



See above


Path the ldapadd executable, for online migration (if not in the path or /usr/local/bin or /usr/bin)


Path the ldif2ldbm executable, for offline migration (if not in the path or /usr/local/bin or /usr/bin)


Path to the Perl interpreter (if not /usr/bin or /usr/local/bin)


Your LDAP server, for online migration. This is optional; you'll be prompted if the environment variable is not set.


See above ($DEFAULT_BASE). This is optional; you'll be prompted if the environment variable is not set.


The distinguished name to bind to the LDAP server as, for online migration. This is optional; you'll be prompted if the environment variable is not set.


The password to bind to the LDAP server with, for online migration. This is optional; you'll be prompted if the environment variable is not set.

You will probably wish to use a shell script or makefile to automate population of your LDAP database, either off-lien (with ldif2ldbm) or on-line (with ldapadd). The migrate_all_*.sh shell scripts do this, but you may wish to customize their behaviour. The following table explains which migration scripts to use:

Shell script

Existing nameservice

LDAP running?

/etc flat files


/etc flat files











Net | 评论(0) | 引用(0) | 阅读(5251)