We help IT Professionals succeed at work.

Exporting & Importing WAS profiles

RishiBang
RishiBang asked
on
Hi,

I have to clone the WebShere installation for a mock DR exercise.

My requirement is in such a way that the import operation should only import the configuration into the Target WAS server without dropping the Source server's cell, Node folders as it is.

It should use the same cell & node names in the target server and just import/copy the configurations as it is.

I came to know abt the AdminTask.exportWASProfile() and AdminTask.importWasProfile() jython methods from the info center.

I am able to export the WAS profile on Source WAS Server as myprofile.car.

I have created the new profile in the target server to match exactly the Source server.

But when I tried to import it I have observed that the import process is creating the Cell, node folders as defined in the archive (for ex it has created the source cellname folder in installed apps of the target server. I DONT want this behavior.

I tried to provide the cellname and nodename of the target server as params but the importwasprofile method/command says they are invalid.

I request anyone in EE to provide the solution or best approach for this.

Thanks,
Rishi

Comment
Watch Question

exportprofile command will not work where you have dmgr and nodeagent...etc,. It will work only with standalone websphere ( comes with server1)

-----------------------------
Use the exportWasprofile  command to export the entire cell configuration to a configuration archive. The exportWasprofile  command does not work between the distributed and z/OS platforms.

Note: Only a base server configuration with single node is supported for the exportWasprofile command.
--------------------------------------------

I have another simple way to clone the websphere env if you want to use same cellname and nodename.

1) installed same websphere version includin fixpack on new machine

Note you have to  make sure to use same install path for example

if you have old machine install path c:/webspherev6.1/appserver

Then you need give same install path on new machine c:/webspherev6.1/appserver

2) create dmgr and nodeprofile on new machine

3) you need to stop the dmgr, nodeagent and all application server on old machine

4) You can tar/zip up the complete dmgr profile dir and node profile from old machine and untar/unzip on new machine under c:/webspherev6.1/appserver/profiles  and change the hostname entries in the websphere configuration and

Use follow link for changing hostname ( chaper 2)  WebSphere Application Server V6.0 best practices for configuration changes

http://www-01.ibm.com/support/docview.wss?rs=&uid=swg27007419

5) one new dmgr is up and manually sync the node with dmgr using syncnode command.

from node bin syncnode newdmgrhostname dmgrsoapport -username user -password password


6)  once sync went fine start the nodeagent and make sure sync status shows correctly on dmgr console and then start all application server from dmgrconsole

Hope this helps you
HonorGodSoftware Engineer
Commented:
What version of WebSphere are you using?

If you are using V7, you should probably investigate the Properties Based Configuration.  There are a series of articles on developerWorks about V7 and this topic is covered in Part 4.

Part 1: An overview of administrative enhancements
  http://www.ibm.com/developerworks/websphere/techjournal/0811_apte/0811_apte.html

Part 2: New administrative topologies
  http://www.ibm.com/developerworks/websphere/techjournal/0901_cundiff/0901_cundiff.html

Part 3: Administering a flexible management topology
  http://www.ibm.com/developerworks/websphere/techjournal/0903_khalil/

Part 4: Properties-based configuration
  http://www.ibm.com/developerworks/websphere/techjournal/0904_chang/0904_chang.html

Author

Commented:
AdminRAM

Thanks for the detailed info for cloning WAS Dmgr installation.

Currently I am working on exporting and importing WAS base 6.1 profiles only.

HonorGod,

We are not yet completely into WAS 7.

What basically I am looking is tell the importProfile Command to take the desired cell and node names while importing a profile if possible

Or Any wsadmin script is available for changing cell name and node name(like the script 4 changing the host name AdminRAM mentioned above) after I import the .car file into the profiles folder

Thanks,
Rishi
For standlaone profile also my steps will works

1) installed same websphere version includin fixpack on new machine

Note you have to  make sure to use same install path for example

if you have old machine install path c:/webspherev6.1/appserver

Then you need give same install path on new machine c:/webspherev6.1/appserver

2) create base profile

3) You can tar/zip up the complete  base profile dir from old machine and untar/unzip on new machine under c:/webspherev6.1/appserver/profiles  and change the hostname entries in the websphere configuration and

Use follow link for changing hostname ( chaper 2)  WebSphere Application Server V6.0 best practices for configuration changes

http://www-01.ibm.com/support/docview.wss?rs=&uid=swg27007419

4)start the server1

you can use this link for changing the cellname and nodename ( see chapter 3 and 4)

http://www-01.ibm.com/support/docview.wss?rs=&uid=swg27007419



Scripts for WebSphere Application Server configuration changes

Download sample scripts that change, export, and import existing configuration data for WebSphere Application Server. Versions of these scripts are available for WebSphere Application Server 5.1.1 and for version 6. For the version 6 scripts in the Network Deployment environment, the scripts can be used in mixed cell environment where WebSphere Deployment Manager is Version 6 and all other federated WebSphere Application Servers can be Version 5.1.1 and/or Version 6.

These scripts are invoked through ws_ant. Scripts that perform the following tasks are included:

    * change host name
    * change cell name
    * change node name
    * change server name
    * export/import the whole repository config directory
    * export/import individual application server
    * export/import enterprise application
    * export/import JDBC Provider with associate Data Sources


Sample Scripts for WebSphere Application Server
http://www.ibm.com/developerworks/websphere/library/samples/SampleScripts.html

In v6.1 changing cellname need to make sure the following files
 
deployment.xml of applications

security.xml

cell.xml

variable.xml...

I am not sure if the above sample script will make changes under security.xml...
HonorGodSoftware Engineer
Commented:
Changing names (e.g., cellName, nodeName) manually is a challenge.  Be careful.
Radek BaranowskiFull-stack Java Developer
Commented:
exactly, honorgod! after you mess with names, you may find your restoreConfig won't recognize the objects to be recovered. tough time, then :)
Radek BaranowskiFull-stack Java Developer
Commented:
to the merit: try to import the profile without creating ANY profiles prior to import on the target machine. invoke wsadmin from <APPSERVER_INSTALL_ROOT>/bin to do it.
HonorGodSoftware Engineer

Commented:
Thanks for the assist and the points.

Good luck & have a great day.
Thank you very much for the points.
Have a good day.