Sun ONE logo      Previous      Contents      Index      Next     

Sun ONE Application Server 7 Migrating and Redeploying Server Applications Guide

Appendix B
Sun ONE Migration Toolbox

Sun ONE Migration Toolbox (S1MT) is used primarily to migrate applications built on NetDynamics or Kiva/NAS platforms to Sun™ ONE Application Server or any J2EE compatible containers. The main interface for the Sun ONE Migration Toolbox is what we call the Toolbox application, or the Toolbox GUI. This application can be invoked by running the %MIGTBX_HOME%/bin/toolbox.bat script (provided the setenv.bat file has been customized appropriately, see README.txt for more information).


Supported Platforms

Microsoft Windows NT 4.0 and Windows 2000 currently support S1MT. Although it is expected that the application can be run on other Win32 platforms (Windows 95/98/Me), these platforms have not been tested and may require additional configuration beyond that specified in the S1MT installation documentation.

The Toolbox require atleast JavaSoft JDK 1.2.2 (JDK 1.3.1 has been tested) to run successfully.


Migration

The toolbox is set of tools which perform different aspects of migration. S1MT 1.2.3 support migration from NetDynamics and Kiva/NAS platforms. Each platform has its own Toolbox Builder which when executed will create a set of tools used to migrate a application. Kiva Migration Toolbox Builder creates tools for Kiva/NAS application migration and similarly NetDynamics Migration Toolbox Builder is used for migrating NetDynamics applications. The following figure shows you how to invoke a toolbox builder.

Figure shows how to invoke the Kiva Migration Toolbox Builder.

Toolbox Builder

You will use the same basic set of tools for each migration you perform, but each tool will need to be customized to that particular migration. Creating each of these tools can be a tedious task and prone to inconsistencies in naming conventions and layout of directory structures. Therefore, we've created a toolbox add-in (a pre-configured, ready-to-run tool) to simplify the process of creating these tools and setting their properties appropriately. Many of the tools have similar or even the same properties where consistency is important to the success of your migration.

Kiva Migration Toolbox Builder

The following are the steps for creating a new toolbox using the Kiva Migration Toolbox Builder add-in:

  1. If you don't have the Toolbox application currently running, start the Toolbox and select the menu option Add-In|Migration|Kiva Migration Toolbox Builder.
  2. After a few moments, you will be prompted by a series of dialog boxes that will request some information. This information will be used by the Toolbox Builder to fill property values for the tools it generates. Some of the properties that you are not prompted for will contain defaults that may or may not need to be modified after the tools are created by the Toolbox Builder.
  3. First, you are prompted for the package which the new JATO Application will be placed in. The best way to understand what this means is to run the OnlineBankSample migration and learn how a new package is created under ./war/WEB-INF/classes to contain the JATO material. Although all the existing Java code is left in the same package, there is a need to create some new Java code for the JATO Application infrastructure. The new package is for this code. Please note that ALL Java source from the original application may remain in the same package. It is only the new Java source for the JATO resources which need a new package defined. No matter what package you choose (e.g. com.iplanet.migration.samples.onlinebank), the last name in the package will be used as the default directory name for the migration results. You can override this directory location in the next panel; we recommend taking all the default values.
  4. Next, you are provided the choice of using the Automatic Application Extract Archive Wizard. This wizard will help create tools for creating the application extract archive. If you choose Cancel then you are simply asked for the application extract archive (ZIP/JAR) path name. This is the name of the zip or JAR file which contains all the source for the application. In this case the archive must have been created manually beforehand and the wizard continues with encoding specifications.
  5. If you choose OK for the Automatic Application Extract Archive Wizard then you are asked to enter the root directory to the application source (this is normally the ./nas/APPS directory).
  6. Next, you are asked to provide a list of top level packages in the application source directory pertinent to this migration. If all the source in the directory is included then you can skip specifying a value.
  7. Next, you are asked to provide a list of file extensions which will be included in the Application Extract Archive.
  8. If you choose OK for the Automatic Application Extract Archive Wizard then you will see a Task tool and Copy Directory tool and Java tool added to the toolbox.
  9. There are two (2) panels which ask for the character encodings for Java source and query files. There are many customers who have Java source in an alternate character encoding (not ASCII). For instance, it is common for Asian developers/customers to use double-byte character source files. In a change from the S1MT BETA, only one (1) encoding value is allowed for file type. It is assumed that there is a common encoding standard within an application. If there are varying encodings then the application descriptor XML file may be edited accordingly after Extraction. Please note that S1MT 1.2.3 attempts to automatically discover character encoding of HTML templates by inspecting the <meta> tags in the source files. However, the migrator should carefully review the application descriptor XML file for encoding dispositions to ensure proper translation.
  10. At this point the Kiva Extraction and Translation Tools are added to the toolbox.
  11. Lastly, you are provided the choice of using the Automatic Static Document Translation Wizard. This wizard will help create tools for assembling the static document content and translating appropriate documents fixing the URLs for AppLogic invocation and copying the documents to the result WAR directory structure.
  12. If you choose CANCEL then the builder exits. If you choose OK, you are asked to enter the location of the document root for the application and another Task tool, JAR tool, Document Translation tool and Copy Directory tool are added to the toolbox.
  13. Save the toolbox to disk by selecting the menu option File|Save and give it a name.

Invoking the Tools

You are now ready to migrate your application by invoking the generated tools; extraction first and then translation. Before invoking each tool, inspect its properties first and make adjustments as needed. In general, if you've provided desirable initial values to the Toolbox Builder, none of the properties will need to be adjusted.


Note

The Toolbox Builder created one Task Tool in your toolbox which you can use to invoke all of the other generated tools at once. However, we recommend invoking each tool individually until you have migrated one or two applications and become familiar with each tool's output.


Tools Created by Kiva Migration Toolbox Builder

  1. KIVA Application Extraction Tool
  2. This tool reads a zip or JAR file called the application extract archive containing Kiva application files and creates an XML document called an application description file. The application description file contains high level information describing the application including disposition of each file found in the application extract archive.

    This tool assumes, as input, the pre-existence of a zip file containing all of the original NAS/KIVA application source (i.e. templates, applogic java files, other application specific resources). The zip file need not contain the actual original class files since the migration effort will be altering the source files.

    Creation of the application description file is the first step in the automated migration process. Although this file may be useful for other purposes, its main use is as input to the application translation process using the Kiva Application Translation Tool (com.iplanet.moko.nas.tools.KivaTranslateTool).

  3. KIVA Application Translation Tool
  4. This tool reads both a zip or JAR file called the application extract archive containing Kiva application files and also an XML document called an application description file. This tool takes as input an application description file and uses it to generate a set of equivalent J2EE components and files. The application description file (an XML document) is produced as the result of using the Kiva Extraction Tool (com.iplanet.moko.nas.tools.KivaExtractTool) to extract information from a set of source Kiva projects. Use of the translation tool is the second step in performing the automated migration of a Kiva application.

  5. Copy Directory Tool
  6. Copies the contents of a source directory to a target directory

  7. JAR Tool
  8. JARs all files in the source directory and all subdirectories

NetDynamics Migration Toolbox Builder

The following are the steps for creating a new toolbox using the NetDynamics Migration Toolbox Builder add-in:

  1. If you don't have the Toolbox application currently running, start the Toolbox and choose the "Migrate an application" option in the Welcome dialog and press OK. With the Toolbox running, be sure that you have an empty (New) toolbox. Select the menu option Add-In|Migration|NetDynamics Migration Toolbox Builder.
  2. After a few moments, you will be prompted by a series of dialog boxes that will request some information. This information will be used by the Toolbox Builder to fill property values for the tools it generates. Some of the properties that you are not prompted for will contain defaults that may or may not need to be modified after the tools are created by the Toolbox Builder.
  3. First prompt: Enter the logical application name. This is the name of the entire application, which may include more than one NetDynamics project. If the application is only one project, then it is not recommended to use the project name as the application name. For example, if your project is called foo, then call your application fooapp rather than just plain foo. This will prevent confusion with other similar properties and avoid difficulties later during deployment.
  4. After you've entered an application name, the Toolbox Builder will prompt you for more information, providing default values when possible. We recommend taking all the default values.
  5. Once you have finished entering information, The Toolbox Builder will create several tools in your current toolbox. Save the toolbox to disk by selecting the menu option File|Save and give it a name. Using the application name (the value from the first promptófooapp in our example here) as the name of the toolbox is recommended.
  6. Tools generated by NetDynamics Toolbox Builder are shown here:


    Figure shows the tools generated by the NetDynamics Migration Toolbox Builder.

Invoking the Tools

You are now ready to migrate your NetDynamics application by invoking several of the generated tools. Before invoking each tool, inspect its properties first and make adjustments as needed. In general, if you've provided desirable initial values to the Toolbox Builder, none of the properties will need to be adjusted. (NOTE: The Toolbox Builder created one or more Task Tools in your toolbox which you can use to invoke several of the other generated tools at once. However, we recommend invoking each tool individually until you have migrated one or two applications and become familiar with each tool's output.)

Tools Created by Kiva Migration Toolbox Builder

  1. NetDynamics Extraction Tool
  2. This tool gathers as much information as possible from the source NetDynamics project or projects and then writes this information to an XML file called the application description file. This application description will serve as the input to the Application Translation Tool.

    Before invoking this tool, check the following properties for accuracy:

    ProjectsDirectory is the path to the NetDynamics projects directory used during extraction. The default value is %MIGTBX_HOME%/work/NDProjects. We recommend placing all the NetDynamics projects you intend to migrate in this directory.

    All other properties should be fine with their current values unless you made an error during the prompting stages of the Toolbox Builder add-in. The other properties will be discussed in detail later in this document.

    Save the toolbox if you made any changes and invoke the tool. The XML output file (the application description) will be written to the location specified by the OutputDirectory property.

    You may open and browse the application description file if you wish to understand the details of the project extraction. Using an XML browser like XML Spy is recommended. We highly discourage editing this file as mistakes introduced here may significantly affect the translation phase, causing it to fail completely or generate faulty output

  3. Application Translation Tool
  4. This tool uses the application description file generated by the NetDynamics Extraction Tool to output a set of J2EE-compliant components that accurately reflect the structure of the behavior of the original NetDynamics application.

    All other properties should be fine with the current values unless you made an error during the prompting stages of the Toolbox Builder add-in. The other properties will be discussed in detail later in this document.

    Save the toolbox if you made any changes and invoke the tool. The new J2EE components will be written to the location specified by the OutputDirectory property.

    Additionally, this tool places a migration log file (MigrationLog.csv) in the translation output directory. This file indicates various items that were identified during translation as requiring additional or special migration attention. Our reason for generating this file is to alert migration developers to those items that were not automatically handled by the translation, and to record information that was otherwise not carried forward during translation. This file generally serves as a minimal task list for the manual portion of the migration (there will likely be other tasks as well not related directly to the translation).

  5. Regular Expression Mapping Tool
  6. This tool, also known as the Regexp Tool, uses a set of XML-specified match and replace specifications to effect changes within files (note, this tool uses the Perl 5 regular expression syntax). The Toolbox Builder generates a Regexp Tool that is preconfigured to replace common Spider API Java constructs with equivalent JATO constructs in your migrated Java source files.

    Before invoking this tool, check the following properties for accuracy:

    SourceDirectory is the location of your migrated application code. Please make sure that this directory does not also contain the JATO source files, as the processing of those files may cause unexpected problems.All other properties should be fine with the current values unless you made an error during the prompting stages of the Toolbox Builder add-in.

    Save the toolbox if you made any changes and invoke the tool. The migrated source files will be processed and any changes that occur will be written to the console. Before any file is modified, the tool will backup the original file in its original location with a .orig file extension.

    IMPORTANT: At this point, you have completed the automated migration phase, and must now port the Java code in the migrated application to use the J2EE/JATO API instead of the NetDynamics Spider API. The remaining tools described below will be useful for packaging and deploying your application once manual migration has been completed, with one exception: the migrated application should compile successfully at this point and minimally run if deployed (pages can be invoked); however, the application may not be functional if you've used any of the NetDynamics Spider API. Therefore, unless you want to simply make a sanity check or check the migration of non-Spider dependent features, we recommend porting at least part of the migrated application before continuing.

  7. Java Compiler Tool
  8. This tool is a convenient way to compile the JATO Foundation Classes and the new J2EE application components with one click. This tool simply invokes the javac command line tool provided with the JDK.

    There should be no properties that need adjusting in this tool unless changes were made to the output directory properties of the previous tools. All of the properties will be discussed in detail later in this document.

    Save the toolbox if you made any changes and invoke the tool. All of the java class source files (.java) under the directory specified by the SourceDirectory will be compiled.

  9. Copy Directory Tools (Create WAR File Directory Structure)
  10. This tool copies directories/files from one location to another with a file filter capability. The goal of the generated tools of this type is to create a "WAR file ready" directory structure. Running the first four Copy Directory Tools will copy the deployment descriptor, tag lib definition, JSPs, and Java classes into the appropriate directories so that the Jar Tool can be used to create a WAR file to be deployed in your J2EE container.

    The instance of the Copy Directory Tool labeled CopySource is optional. The source files are not needed in your production WAR file, but you may find it helpful to keep a copy of the source files with your deployed application to ensure proper version control (these may also come in handy if a quick fix is necessary at the deployment site). These source files will not be visible to any application clients, and will therefore remain safe on your deployment server.

    All of the properties should be fine with the current values unless you made changes to the output directory properties of the previous tools. All of the properties will be discussed in detail later in this document.

    Save the toolbox if you made any changes and invoke the first four copy directory tools (CopyDeplDesc, CopyTLD, CopyJSP, CopyClasses). Invoke the fifth copy directory tool (CopySource) if this makes sense for your environment. Once these tools have been invoked, the appropriatly filtered files will be written to the directory specified by each of the tools' respective OutputDirectory property. The application is now ready to be "WAR'ed".

  11. Jar Tool
  12. This tool uses the JAR command line tool from the JDK to create a WAR file using the directory structure created by the previous copy directory tools. This WAR file will be the only file you will need to deploy your application to the J2EE container. (The iAS deployment procedure is discussed in the JATO Deployment Guide). Each container generally has its own deployment procedure; please follow the instructions for your container.

    All of the properties should be fine with the current values unless you made changes to the output directory properties of the previous tools. All of the properties will be discussed in detail later in this document.

    Save the toolbox if you made any changes and invoke the tool. The WAR file will be created and written to the location specified by the OutputDirectory property. The application is ready to be deployed.


Tools and Toolboxes

Toolboxes are persisted to disk in the format of a toolbox file (.toolbox). Individual tools of the toolbox are contained in the toolbox file in a serialized object format. These individual tools can exist outside of the toolbox file as a tools file (.tools) in a similar format. There are several menu commands that allow you to create, copy, delete, and merge two toolboxes together, as well as import and export individual or groups of tools.

Creating New Tools

To create a new instance of any tool, use the Tool|New menu option and select the type of tool you would like to create (Extraction, Translation, Compilation, etc.). You will notice the new tool will be added to currently opened toolbox in the toolbox tree. It will be grouped with other tools of its type and will have a default name of the form <ToolType><##>, like CopyDirectoryTool7. You can triple-click the tool name or press F2 to rename it as you wish. Spaces are allowed in tool names.

Cloning Tools

To create a copy of a current tool, use the Tool|Clone menu option and a new tool of the same type will be created with the same properties as the original. Rename and adjust properties as needed.

Deleting Tools

To delete a tool, use the Tool|Delete menu option and the tool will be removed from the toolbox. You will be prompted verify your delete tool command, but there is no undo action. You may select several tools to delete at once by holding down the Ctrl or Shift keys while selecting additional tools.

Importing & Exporting Tools

You may have many different toolboxes (.toolbox files) that are focused on different NetDynamics application migrations. With the import and export commands, you can export a tool to a .tools file and then import it into another toolbox (.toolbox file).

To export a tool, open the toolbox with the tool you wish to export, select the tool or tools in the toolbox tree, then use the File|Export menu option and name the .tools file to export the tool. The tool will not be removed from the current toolbox.

To import the tool into another toolbox, open the toolbox you wish to be imported, then use the File|Import menu option, browse to the location of the .tools file you wish to import, then save the toolbox.

Toolbox Merging

If you have two separate toolboxes and would like to merge them into single toolbox you use the merge toolbox feature of the Open Toolbox menu option. To merge two toolboxes into one toolbox, open one of the toolboxes, and while it is open, open the other toolbox. You will be prompted to replace the existing toolbox, merge the new toolbox with the already-open toolbox, or cancel the operation.


Troubleshooting

IMPORTANT: Before continuing, make sure you have the latest S1MT patches available from the Sun ONE Migration Website. We will be releasing patches regularly as we discover and diagnose difficulties. We will release most of these patches to address problems found by users of the S1MT. Please submit any problems you encounter to the S1MT team so that we can diagnose the problem and issue a patch if necessary.

Toolbox Installation & Configuration

If you have difficulty running the Toolbox application, consult the following:

Extraction

For the most part, as we've mentioned above, extraction of an application description is the most likely step in which you will encounter errors or difficulties. Also as we've already mentioned, this is frequently a normal part of the migration process and shouldn't discourage you if you are following the steps in previous sections. If you are having difficulties not covered above, consult the following tips.

General Issues

Non-Fatal Error During Extraction

If only part of the automated migration succeeds (or fails), we recommend the following:

Fatal Error During Extraction

Ensure the following items are not factors in the failure (in approximate order of likelihood):

  1. Incorrect environment settings. Check the settings of your %MIGTBX_HOME%/bin/setenv.bat file and ensure they are appropriate for your machine.
  2. Missing external classes
  3. Incorrect tool property settings. Ensure that the Extraction Tool has valid property settings
  4. Use of non-existent runtime feature in a critical location (such as a class initializer or initialization of non-Spider threads to perform background tasks)
  5. Non-present links directory or corrupted class files
  6. Use of incorrect JDK version or platform
  7. Conflicting class file versions in boot classpath (such as those present in the JDK's extension directory)

If none of the above items are discernable factors in the problem, you may have encountered a bug in the S1MT. We reiterate that because of the latitude NetDynamics allowed during project development, Sun ONE cannot anticipate all possibilities and thus ensure a trouble-free migration for all customers. However, the S1MT is committed to making the migration process as painless as possible. Please report any problems to the S1MT team and/or the discussion forums so that we may address them and issue patches as necessary.

Translation

If you encounter an error during application translation, do the following first:

If none of the above items are discernable factors in the problem, you may have encountered a bug in the S1MT. We reiterate that because of the latitude NetDynamics allowed during project development, Sun ONE cannot anticipate all possibilities and thus ensure a trouble-free migration for all customers. However, the S1MT is committed to making the migration process as painless as possible. Please report any problems to the S1MT team and/or the discussion forums so that we may address them and issue patches as necessary.

Post-Migration

Some problems may arise after migration or during testing. In general, such problems will need to be posted to the discussion forums or discussed with the S1MT team. However, before contacting others, note the following:



Previous      Contents      Index      Next     


Copyright 2003 Sun Microsystems, Inc. All rights reserved.