Migrating from wscp V4.0 to wsadmin V5.x

Overview

The purpose of this section is to provide guidance for migrating from WebSphere Application Server V4.0 wscp scripts to wsadmin in V5.x.

[V5.1 and later]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 V5.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 V5.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 V5.x, a distinction is made between configurational and operational commands.

  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 V5.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 V5.x that you performed in V4.0. Use the following table to determine the corresponding types:

    V4.0 wscp command V5.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 V5.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 V5.x wscp:

    wscp 4.0 wsadmin 5.x wsadmin 5.x wsadmin 5.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 V5.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

    [V5.1 and later]Using Jython:

    AdminConfig.save()


Related reference
Example: Migrating - Creating an appserver
Example: Migrating - Starting an appserver
Example: Migrating - Starting a server group
Example: Migrating - Installing an application
Example: Migrating - Installing a JDBC driver
Example: Migrating - Creating a server group
Example: Migrating - Stopping a node
Example: Migrating - Stopping an appserver
Example: Migrating - Listing the running server groups
Example: Migrating - Pinging running servers for the current state
Example: Migrating - Listing configured server groups
Example: Migrating - Regenerating the node plug-in configuration
Example: Migrating - Testing the DataSource object connection
Example: Migrating - Cloning a server group
Example: Migrating - Enabling security
Example: Migrating - Disabling security
Example: Migrating - Modifying the virtual host
Example: Migrating - Modifying and restarting an appserver
Example: Migrating - Stopping a server group
Example: Migrating - Removing an appserver
Example: Migrating - Modifying the embedded transports in an appserver
Example: Migrating - Connecting to a remote server
Example: Migrating - Uninstalling an application
Example: Migrating - Editing an application
Example: Migrating - Modifying attributes of appservers, applications, and other configured objects
Example: Migrating - Displaying help
Example: Migrating - Listing actions available for configured objects
Example: Migrating - Setting the trace specification
Wsadmin tool