Friday, April 9, 2010

Migrate Sun PAB to Communications Express

Recently I've been working with migrating an instance of Sun's Messaging Server to use UWC communications express, which involves moving all user's PAB entries to new PiServerDB entries.

Seriously.. This too way to long to figure out, first that there even was a tool to use, and then how to get it to work. Thanks again Sun (or i guess now, Oracle) for providing a research project instead of a solution, at least it was fun.

This is all on Solaris 10 but should work on any platform.

quick and dirty script to use the pab2abs.pl migration tool:

#!/bin/bash
#migrateUsers.sh
#replace the host, dn, and passwords according to your environment
#
#get the PAB entries
ldapsearch -h ldap.mydomain.com -1 -T -D cn="Directory Manager" -w supersecretpassword -b ou=$1,ou=people,o=mybasedn,o=pab un=* > $1_tmp

#fix the space-comma problem or pab2abs will fail on random accounts
cat $1_tmp | sed 's/ ,/, /g' > $1_pab

#run pab2abs to generate ldif
perl pab2abs.pl -f params -i $1_pab -o $1_abs.ldif

#add new piserverdb entries
ldapmodify -h ldap.mydomain.com -D cn="Directory Manager" -w supersecretpassword -a -f $1_abs.ldif

#cleanup
mv $1_* migratedUsers/.

Then just build a list of userids that you want to migrate and pass with a loop for the win.

bash# for i in $(cat userlist);do ./migrateUsers.sh $i;done

0 comments:

Post a Comment