Migrate V4.0.x administrative scripts to V6 wsadmin
Overview
The purpose of this section is to provide guidance for migrating from WAS V4.0 wscp scripts to wsadmin in V6.x.
The wscp tool was a part of the WAS V4.0 administration repository support. The repository no longer exists and the tools that manipulate it are no longer needed. Use the V6.x scripting client program, wsadmin, to do the same kinds of things wscp did, and more. 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
- Identify the wscp commands used in your script.
- 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.
- 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 - Determine the V6.x attribute names by using the online help commands of the AdminConfig object. For example: attributes, defaults, parents, required, or types.
- 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.
- 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 - 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:
$AdminConfig saveAdminConfig.save()
See also
Example: Migrating - Creating an application server
Example: Migrating - Starting an application server
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 application server
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 application server
Example: Migrating - Stopping a server group
Example: Migrating - Removing an application server
Example: Migrating - Modifying the embedded transports in an application server
Example: Migrating - Connecting to a remote server
Example: Migrating - Uninstalling an application
Example: Migrating - Editing an application
Example: Migrating - Modifying attributes of application servers, applications, and other configured objects
Example: Migrating - Displaying help
Example: Migrating - Listing actions available for configured objects
Example: Migrating - Setting the server trace specification
See Also
Wsadmin tool