There is no elegant way to do this but the best way I would recommend is to an db2ldif and this would generate an ldif dump of your entire portal ldap database. This is a text file so you can manually search and replace all the hostname, ipaddress for the old hostname with the new hostname and ipaddress and then do ldif2db to import it into the new portal installation.
HTH ...