Monday, June 23, 2008

Export/Import Oracle Internet Directory (OID) users

1. To export OID users with certain attributes:

connect to the source server and issue the following command

ldapsearch -h <host> -p <port> -D "cn=orcladmin" -w <pass> -L -s one –b “cn=users,dc=realsoft,dc=com" -z 1000 "cn=*" dn sn cn uid userpassword objectclass >users.ldif

please note the following:

· -z: is for size limit which means the number of users you want to export.

· “cn=*”: the search filter in our case we want all of them .

· You can define what attributes you want to be exported with the user by adding the attribute name after the search filter e.g: "cn=*" dn sn cn uid userpassword objectclass

· Users.ldif: the name of the export file.

 

now in case you want all attributes, simply don't write any attribute after search filter..:)

2. To Import OID users:

· Connect to the destination server

· Transfer the file Users.ldif from the source server to the destination(in case of  UNIX, transfer the files using ASCII mode)

· Issue the following command:

ldapadd -h <host> -p <port> -D "cn=orcladmin" -w <pass> -c -v –f users.ldif

Thanks.

Sultan

2 comments:

thalesmta said...

thank you, but my problem is that the the atributte userpassword is encrypted and need this atributte decrypted because after exporting users from a OID branch I have to importing that user in another OID branch but with the same userpassword.
Thank you.

Anonymous said...

i have use to the following:
ldapadd -h host -p port -D "cn=orcladmin" -w pass -c -v –f users.ldif

but result is zero for
emport command line as above ..?

Pl. suggest once again..!