Thursday, June 30, 2011

Weblogic Security Realm WLST import and export

This is just a reminder for myself, the code is not mine but can be found at multiple places on the web so I have no idea who the initial owner is and who to give credits.

I took it from http://icanjango.appspot.com/jvzoggel.blogspot.com/2011/06/weblogic-security-realm-wlst-import-and.html



export configuration:

java weblogic.WLST

connect('weblogic','weblogic', 't3://somedomain:7001')

domainRuntime()

cd('/DomainServices/DomainRuntimeService/DomainConfiguration/FirstDomain/SecurityConfiguration/FirstDomain/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator')

cmo.exportData('DefaultAtn','/tmp/export.ldif', Properties())

import configuration:

java weblogic.WLST

connect('weblogic','weblogic', 't3://someotherdomain:7001')

domainRuntime()

cd('/DomainServices/DomainRuntimeService/DomainConfiguration/SecondDomain/SecurityConfiguration/SecondDomain/DefaultRealm/myrealm/AuthenticationProviders/DefaultAuthenticator')

cmo.importData('DefaultAtn','/tmp/export.ldif', Properties())