Websphere : How to change HOSTNAME using ws_ant scripts
Today I have a new_server which I need to build to my websphere old_server. The first thing to do is rename Hostname from old_server to new_server. Here is a script I used to just do that.
Download “Configuration management scripts for V6 ConfigScripts.zip” from http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html
Sample exportImport.xml attached here http://www.oracledbasupport.co.uk/wp-content/uploads/2010/08/exportImport.xml
[websphere@new_server config_management]$ /opt/IBM/WebSphere/AppServer/bin/ws_ant.sh -profileName dmgr -buildfile exportImport.xml -DstartManager=yes -DoldHostName=old_server -DnewHostName=new_server change HostName
[wsadmin] WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
[wsadmin] Executing ValidateRelease.jacl script
[wsadmin] List of Node is new_server_Manager(cells/old_server_Cell/nodes/old_server_Manager|node.xml#Node_1)
[echo] Was Home is /opt/IBM/WebSphere/AppServer
[echo] User Install Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr
[echo] Config Root is /opt/IBM/WebSphere/AppServer/profiles/Profile01/dmgr/config
[echo] Cell name is old_server_Cell
[echo] Node name is old_server_Manager
[echo] Modifying serverindex.xml from old_server to new_server
[echo] Modifying server.xml from old_server to new_server
[echo] Modifying wsadmin.properties from old_server to new_server
[exec] ADMU0116I: Tool information is being logged in file
[exec] ADMU0128I: Starting tool with the dmgr profile
[exec] ADMU3100I: Reading configuration for server: dmgr
[exec] ADMU3200I: Server launched. Waiting for initialization status.
[exec] ADMU3000I: Server dmgr open for e-business; process id is 22554
Total time: 28 seconds
[websphere@new_server config_management]$ ps -ef | grep java
Now let’s connect to the new DMGR using URL https://new_node:9043/ibm/console/ . I could connect successfully with username /pwd as of old_server