Migrating V4.0.x administrative scripts to V6 wsadmin

This section provides guidance for migrating from WebSphere Application Server V4.0 wscp scripts to wsadmin in V6.x.

About this task

The wscp tool was a part of the WebSphere Application Server V4.0 administration repository support. The repository no longer exists and the tools that manipulate it are no longer needed. You can use the V6.x scripting client program, wsadmin, to do the same kinds of things wscp did, and more. You can use the Jacl and Jython scripting languages for scripts, but the elements specific to wsadmin are different from those available in wscp. This article shows how to create WebSphere Application Server V6.x scripts that perform actions similar to those performed by V4.0 wscp. Automatic conversion of scripts between the two releases is difficult.

The wsadmin scripting client uses the Bean Scripting Framework (BSF), and is based on Java Management Extensions (JMX).

In V4.0, wscp commands are used for both configuration queries or updates, and operational commands. In V6.x, a distinction is made between configurational and operational commands.

Procedure

  1. Identify the wscp commands used in your script.
  2. Determine if each command is used for configuration or operation.
    • Configuration commands include the following: create, list, modify, remove, show, showall, install, uninstall, all SecurityConfig commands, all SecurityRoleAssignment commands, clone, and removeClone.
    • Operation commands include the following: start, stop, show (if for a run-time attribute), testConnection, all DrAdmin commands, and regenPluginCfg.
    • Other commands exist to provide help for configuration commands. These commands include the following: attributes, containment, and help.
  3. Find the corresponding configuration wsadmin V6.x object type for each configuration commands. Use the AdminConfig create, list, modify, remove, show, and showAttribute commands to perform the same type of operations in V6.x that you performed in V4.0. Use the following table to determine the corresponding types:
    V4.0 wscp command V6.x wsadmin configuration type
    ApplicationServer Server
    Context Not applicable
    DataSource WAS40DataSource, DataSource
    Domain Not applicable
    EnterpriseApp ApplicationDeployment
    GenericServer Server
    J2CConnectionFactory J2CConnectionFactory
    J2CResourceAdapter J2CResourceAdapter
    JDBCDriver JDBCProvider
    JMSConnectionFactory JMSConnectionFactory
    JMSDestination JMSDestination
    JMSProvider JMSProvider
    MailSession MailSession
    Module ModuleDeployment
    Node Node
    ServerGroup ServerCluster
    URL URL
    URLProvider URLProvider
    VirtualHost VirtualHost
  4. Determine the V6.x attribute names by using the online help commands of the AdminConfig object. For example: attributes, defaults, parents, required, or types.
  5. Convert application installation commands. For application installation, use the AdminApp object installInteractive command to complete a successful installation. Then locate message WASX7278I in the wsadmin.traceout log file and use the data in the message to construct an installation command for your source.
  6. Convert operational commands. Use the following table to determine how to deal with operational commands in V6.x wscp:
    wscp 4.0 wsadmin 6.x wsadmin 6.x wsadmin 6.x
    action Object and command Mbean, if any Operation, if any
    server start AdminControl startServer    
    server stop AdminControl stopServer    
    servergroup start AdminControl invoke Cluster start
    servergroup stop AdminControl invoke Cluster stop
    application start AdminControl invoke ApplicationManager startApplication
    application stop AdminControl invoke ApplicationManager stopApplication
    node stop AdminControl invoke <nodeagent> stopNode
    check run-time attribute AdminControl getAttribute <mbean> <attribute>
    check run-time attributes AdminControl getAttributes <mbean> <list of attributes>
    regenPluginCfg AdminControl invoke PluginCfgGenerator generate
    testConnection AdminControl testConnection    
    enable security securityon command    
    disable security securityoff command    
  7. Save configuration changes. In V6.x, configuration changes are made to a temporary workspace. These changes are not committed to the WebSphere Application Server configuration until you invoke the save command on the AdminConfig object. If your script makes configuration changes, for example, creates, removes, or changes objects, or installs or uninstalls applications, invoke the following command to commit the change:
    Using Jacl:
    $AdminConfig save
    Using Jython:
    AdminConfig.save()



In this information ...


Related reference

IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Aug 29, 2010 10:43:27 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=v602web&product=was-nd-mp&topic=txml_migrate4to6
File name: txml_migrate4to6.html