How do I export a Web Application from WebSphere?

(Last modified: 22Nov2002)

This document (10062329) is provided subject to the disclaimer at the end of this document.

goal

How do I export a Web Application from WebSphere?

fact

IBM WebSphere 3.5 [Advanced Edition]

IBM WebSphere 3.5 [Standard Edition]

fix

Procedure:

**NOTE** In this document the example shown below is exporting a Web Application called OnDemand from the Developer's Web Application Server (DEV) in order to import the same Web Application into the  Tester's Web Application Server (TEST).

(1) The first thing that will need to be done is to create the XML file that will export the proper information from WebSphere Application Server. There are a few things here that you will need to change to match your server.

(2) First, the forth line down contains <node name="mynode" action="locate">. Change "mynode" to be the name of your WebSphere node. It should be the same name as your server.  If the name of your server was DEV then you would modify the node name to look like the following:  <node name="DEV" action="locate">

(3) Lines five, six, and seven deal with naming your Managed Server, Servlet Engine, and Web Application consecutively.  Here the assumption is that your Web Application is under the Managed Server (Default Server), that the Servlet Engine is (Default Servlet Engine) and that it is the Web Application that will be different.

**NOTE**  The doted lines shown below are not part of the file. They are simply used for formatting reasons to separate the files so they are easier to read.  Do not put them in as part of your file.

---------------------------------

<?xml version="1.0"?>
<!DOCTYPE websphere-sa-config SYSTEM "$server_root$$dsep$bin$dsep$xmlconfig.dtd" >
<websphere-sa-config>
    <node name="mynode" action="locate">
       <application-server name="Default Server" action="locate">         
          <servlet-engine name="Default Servlet Engine" action="locate">
             <web-application name="default_app" action="export">
             </web-application>
          </servlet-engine>
       </application-server>
    </node>
</websphere-sa-config>

---------------------------------

**NOTE** Listed below is what your file should look like after following the steps one, two, and three.

---------------------------------

<?xml version="1.0"?>
<!DOCTYPE websphere-sa-config SYSTEM "$server_root$$dsep$bin$dsep$xmlconfig.dtd" >
<websphere-sa-config>
    <node name="DEV" action="locate">
       <application-server name="Default Server" action="locate">         
          <servlet-engine name="Default Servlet Engine" action="locate">
             <web-application name="OnDemand" action="export">
             </web-application>
          </servlet-engine>
       </application-server>
    </node>
</websphere-sa-config>

---------------------------------

(4) Save the file with what ever name you desire. In this example we will simply call it EXPORT.XML. You can save this file at any location on the server but if you save it anywhere other than the SYS volume then you will need to specify that path within the partial export command that will be run at the server. In this example we will not be specifying the path since it will be saved at the root of the SYS volume.

(5) We are now ready to run the export from the Developers Server. At the server console prompt type the following making sure that you place the directives in the proper case:

XMLConfig -export OnDemand.xml -adminNodeName DEV -partial export.xml

**NOTE**  It may take a moment to get started. Make sure that you watch the console screen for any errors. You know if it is successful if you see the export happen and then XMLConfig will exit successfully without any errors listed before or during the exiting process.

(4) You can see an example of the OnDemand Web Application that was exported This is the OnDemand.xml file we just created:

---------------------------------

<?xml version="1.0"?>
<!DOCTYPE websphere-sa-config SYSTEM "$XMLConfigDTDLocation$$dsep$xmlconfig.dtd" >

<websphere-sa-config>
  <node name="DEV" action="locate">
    <application-server name="Default Server" action="locate">
      <servlet-engine name="Default Servlet Engine" action="locate">
        <web-application name="ondemand" action="update">
          <description>OnDemand Web Application</description>
          <document-root>SYS:\OnDemand\WebApp\web</document-root>
          <classpath>
            <path value="sys:/ondemand/webapp/servlets"/>
          </classpath>
          <error-page>/ErrorReporter</error-page>
          <filter-list/>
          <group-attributes/>
          <auto-reload>true</auto-reload>
          <reload-interval>9000</reload-interval>
          <enabled>true</enabled>
          <root-uri>default_host/on-demand</root-uri>
          <shared-context>false</shared-context>
          <shared-context-jndi-name>SrdSrvltCtxHome</shared-context-jndi-name>
          <servlet name="snoop" action="update">
            <description>Snoop servlet</description>
            <code>SnoopServlet</code>
            <init-parameters>
              <parameter name="param1" value="test-value1"/>
            </init-parameters>
            <load-at-startup>false</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/servlet/snoop"/>
              <uri value="/servlet/snoop2"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="ErrorReporter" action="update">
            <description>Default error reporter servlet</description>
            <code>com.ibm.servlet.engine.webapp.DefaultErrorReporter</code>
            <init-parameters/>
            <load-at-startup>true</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/ErrorReporter"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="invoker" action="update">
            <description>Enables Serving Servlets By Classname</description>
            <code>com.ibm.servlet.engine.webapp.InvokerServlet</code>
            <init-parameters/>
            <load-at-startup>true</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/servlet"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="jsp10" action="update">
            <description>JSP 1.0 support servlet</description>
            <code>com.sun.jsp.runtime.JspServlet</code>
            <init-parameters/>
            <load-at-startup>true</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="*.jsp"/>
              <uri value="*.jsv"/>
              <uri value="*.jsw"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="appfile" action="update">
            <description>App file serving servlet</description>
            <code>com.novell.web.servlet.commerce.WebAppFileServlet</code>
            <init-parameters>
              <parameter name="defaultPage" value="index.html"/>
              <parameter name="rootPath" value="sys:\ondemand\econtent"/>
              <parameter name="authSessionObjName" value="AuthSessionObject"/>
              <parameter name="webconfig" value="sys:\system\webconfig.properties"/>
            </init-parameters>
            <load-at-startup>false</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/content"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="DefaultOnDemandServlet" action="update">
            <description>Main servlet</description>
            <code>com.novell.web.servlets.DefaultOnDemandServlet</code>
            <init-parameters>
              <parameter name="webconfig" value="sys:\system\webconfig.properties"/>
            </init-parameters>
            <load-at-startup>true</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/webapp"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
          <servlet name="OnDemandReportServlet" action="update">
            <description>Main Report Servlet</description>
            <code>com.novell.web.servlets.report.OnDemandReportServlet</code>
            <init-parameters>
              <parameter name="webconfig" value="sys:\system\webconfig.properties"/>
            </init-parameters>
            <load-at-startup>false</load-at-startup>
            <debug-mode>false</debug-mode>
            <uri-paths>
              <uri value="/report"/>
            </uri-paths>
            <enabled>true</enabled>
          </servlet>
        </web-application>
      </servlet-engine>
    </application-server>
  </node>
</websphere-sa-config>

---------------------------------

(6) Know before we can import this into the Testers Websphere Application Server we will need to do two things. First we will need to change the Node Name from DEV to TEST.  This is the forth line down.

BEFORE:
<node name="DEV" action="locate">

AFTER:
<node name="TEST" action="locate">

The next thing that should be done is to copy all of your servlets and other files to the TEST server. This will not effect your ability to import but it will complain at you that the files or directory don't exist during the import.

(7) Copy the OnDemand.xml file to the root of the SYS volume and type in the following command at the console prompt:

XMLConfig -adminNodeName TEST -import OnDemand.xml

(8) So long as the import was successful you should now be able to see the Web Application in the other Application Server.

**NOTE** You will need to refresh the Default Server in order to see the Web Application..

document

Document Title: How do I export a Web Application from WebSphere?
Document ID: 10062329
Solution ID: NOVL47622
Creation Date: 08May2001
Modified Date: 22Nov2002
Novell Product Class:NetWare

disclaimer

The Origin of this information may be internal or external to Novell. Novell makes all reasonable efforts to verify this information. However, the information provided in this document is for your information only. Novell makes no explicit or implied claims to the validity of this information.
Any trademarks referenced in this document are the property of their respective owners. Consult your product manuals for complete trademark information.