LDAP-UX Client Services B.05.00 Administrator's Guide

7.6.3.2 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 to put data in the LDAP
directory.
For example, the following command sets the base DN to "o=hp.com":
export LDAP_BASEDN="o=hp.com"
7.6.3.3 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 name service 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.
7.6.4 Examples
The following command converts all name service files in /etc to LDIF:
$ migrate_all_online.sh
The following commands convert /etc/passwd into LDIF and output it to stdout:
$ export LDAP_BASEDN="dc=hp,dc=com"
$ migrate_passwd.pl /etc/passwd
dn: uid=jbloggs,ou=People,dc=hp,dc=com
uid: jbloggs
cn: Joe Bloggs
objectclass: top
objectclass: posixAccount
objectclass: account
userPassword: {crypt}daCXgaxahRNkg
loginShell: /bin/ksh
uidNumber: 20
gidNumber: 20
homeDirectory: /home/jbloggs
gecos: Joe Bloggs,42U-C3,555-1212
The following commands convert /etc/group into LDIF and place the result in /tmp/group.ldif:
$ export LDAP_BASEDN="o=hp.com"
$ migrate_group.pl /etc/group /tmp/group.ldif
dn: cn=mira.hp.com,ou=Groups,o=hp.com
objectclass: posixGroup
objectclass: top
cn: mira
cn: mira.hp.com
userPassword: {crypt}*
gidNumber: 325
The following command migrates /etc/hosts into LDIP and place the result in /tmp/host.ldif:
export LDAP_BASEDN="o=hp.com"
migrate_hosts.pl /etc/hosts /tmp/host.ldif
dn: cn=hostA.hp.com,ou=Hosts,o=hp.com
objectclass: ipHost
objectclass: device
328 Command and tool reference