WAS v8.0 > Migration and coexistence > Distributed operating systems > Migrate administrative scripts > Migrate administrative scripts from a previously v5.1.x application server
Example: Migrating - Modifying web container port numbers
These examples demonstrate how to modify web container HTTP transport ports for WAS v6.x.
Use the following examples:
- wsadmin v5.1.x
Deprecated feature: Using Jacl:
set //publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ Port 7575 set server [$AdminConfig getid /Cell:myCell/Node:myNode/Server:server1/] set transports [$AdminConfig list HTTPTransport $server] set transport [lindex $transports 0] set endPoint [$AdminConfig showAttribute $transport address] $AdminConfig modify $endPoint [list [list port $//publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ Port]] $AdminConfig savedepfeatUse Jython:
//publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ Port = 7575 server = AdminConfig.getid("/Cell:myCell/Node:myNode/Server:server1/") transports = AdminConfig.list("HTTPTransport", server).split(java.lang.System.getProperty("line.separator")) transport = transports[0] endPoint = AdminConfig.showAttribute(transport, "address") AdminConfig.modify(endPoint, [["port", //publib.boulder.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=/ Port]]) AdminConfig.save()
- wsadmin v6.x
Deprecated feature: Using Jacl:
set serverNm server1 set newPort 7575 set node [$AdminConfig getid /Cell:myCell/Node:myNode/] set TCS [$AdminConfig getid /Cell:myCell/Node:myNode/Server:server1/TransportChannelService:/] set chains [$AdminTask listChains $TCS {-acceptorFilter WebContainerInboundChannel}] foreach chain $chains { set channels [lindex [$AdminConfig showAttribute $chain transportChannels] 0] foreach channel $channels { if {[catch {set channelEndPointName [$AdminConfig showAttribute $channel endPointName]} result]} { # ignore the error as not all channel has endPointName attribute } else { set serverEntries [$AdminConfig list ServerEntry $node] foreach serverEntry $serverEntries { set sName [$AdminConfig showAttribute $serverEntry serverName] if {$sName == $serverNm} { set specialEndPoints [lindex [$AdminConfig showAttribute $serverEntry specialEndpoints] 0] foreach specialEndPoint $specialEndPoints { set endPointNm [$AdminConfig showAttribute $specialEndPoint endPointName] if {$endPointNm == $channelEndPointName} { set ePoint [$AdminConfig showAttribute $specialEndPoint endPoint] $AdminConfig modify $ePoint [list [list port $newPort]] break } } } } } } $AdminConfig savedepfeatUse Jython:
serverNm = "server1" newPort = "7575" node = AdminConfig.getid("/Cell:myCell/Node:myNode/") TCS = AdminConfig.getid("/Cell:myCell/Node:myNode/Server:server1/TransportChannelService:/") chains = AdminTask.listChains(TCS, "[-acceptorFilter WebContainerInboundChannel]").split(java.lang.System.getProperty("line.separator")) for chain in chains: channelString = AdminConfig.showAttribute(chain, "transportChannels") channelList = channelString[1:len(channelString)-1].split(" ") for channel in channelList: try: channelEndPointName = AdminConfig.showAttribute(channel, "endPointName") serverEntries = AdminConfig.list("ServerEntry", node).split(java.lang.System.getProperty("line.separator")) for serverEntry in serverEntries: sName = AdminConfig.showAttribute(serverEntry, "serverName") if sName == serverNm: sepString = AdminConfig.showAttribute(serverEntry, "specialEndpoints") sepList = sepString[1:len(sepString)-1].split(" ") for specialEndPoint in sepList: endPointNm = AdminConfig.showAttribute(specialEndPoint, "endPointName") if endPointNm == channelEndPointName: ePoint = AdminConfig.showAttribute(specialEndPoint, "endPoint") AdminConfig.modify(ePoint, [["port", newPort]]) break except: # ignore the error as not all channel has endPointName attribute pass AdminConfig.save()
Migrate administrative scripts