NIS/LDAP Gateway Administrator's Guide

If you change the default naming context, modify the file migrate_common.ph and change it to
reflect your naming context. You must also change the file
/opt/ldapux/ypldapd/etc/namingcontexts.conf. See also “Naming Context Mappings”.
Migrating All Your Files
The two shell scripts migrate_all_online.sh and migrate_all_nis_online.sh migrate
all your NIS maps either to LDIF or into your directory. The migrate_all_online.sh shell
script gets NIS information from the appropriate source files, such as /etc/passwd, /etc/group,
/etc/hosts, and so forth. The migrate_all_nis_online.sh script gets NIS information from
your NIS maps using the ypcat(1) command. The scripts take no parameters but prompt you for
needed information. They also prompt you for whether to leave the output as LDIF or to add
the entries to your directory. These scripts call the perl scripts described under “Migrating
Individual Files”. You may need to modify these scripts to work in your environment.
NOTE: The scripts use ldapmodify to add entries to your directory. If you are starting with an
empty directory, it may be faster for you to use ldif2db or ns-slapd ldif2db with the LDIF
file. See the Netscape Directory Server Administrator's Guide for details on ldif2db and ns-slapd.
If any entry in the migrated LDIF file is already in your directory, the script will stop at that
point. The entries previous to the duplicate will be in the directory. To continue, you can edit
the LDIF files to remove the entries already added up to the duplicate, resolve the duplicate,
then continue adding the remaining entries. Alternatively you can remove the entries from the
directory that were already added, resolve the duplicate, then re-add all the entries from the
LDIF file.
Migrating Individual Files
The following perl scripts migrate each of your NIS source files in /etc to LDIF. These scripts are
called by the shell scripts described under “Migrating All Your Files”. The perl scripts get NIS
information from the input source file and output LDIF.
Environment Variables
When using the perl scripts to migrate individual files, you need to set the following environment
variable:
LDAP_BASEDN The base distinguished name where you want your data.
For example, the following command sets the base DN to "o=hp.com":
export LDAP_BASEDN="o=hp.com"
General Syntax for Perl Migration Scripts
All the perl migration scripts use the following general syntax:
scriptname inputfile [outputfile]
where
scriptname
is the name of the particular script you are using. The scripts are listed below.
inputfile
is the name of the appropriate NIS source file corresponding to the script you
are using.
outputfile
is optional and is the name of the file where the LDIF is written. stdout is the
default output.
Migration Scripts
The migration scripts are:
36 Command and Tool Reference