Migrating applications from Zero to WebSphere sMash

Zero provides access to the latest code; IBM® WebSphere® sMash is based upon only released code. This article provides tips for migrating applications from Zero to WebSphere sMash.

There are two operations to consider when migrating an application: Moving the application from one server to another and migrating to another module group.

Moving applications from one server to another

The package command can be used to help move your applications. package produces a ZIP file of the application directory, which can then be transferred and unzipped onto another server.

  1. Start by invoking zero package in the root directory of the application. For example, to package application myapp located at C:\zeroapps\myapp, change directory to C:\zeroapps\myapp then invoke zero package.
  2. Transfer the generated ZIP file to the other server. (Console output from zero package includes a pointer to the generated file, which will be located in the application's export directory.)
  3. Extract the ZIP file onto the other server.

Migrating applications to another module group

  1. Install the WebSphere sMash command-line interface (CLI) using the installer (available from IBM).
  2. Migrate each application to the "stable" module group by invoking zero switch stable in the root directory of the application. For example, to switch application myapp located at C:\zeroapps\myapp, change directory to C:\zeroapps\myapp then invoke zero switch stable .

Evaluating the success/failure of the migration

Migration should be treated like any other change in software development.

Successful migration means that the application runs correctly with the new dependencies. Before you can claim success, you must complete the migration steps, then perform adequate testing within the new run-time environment.

The following pointers might help you along the way.

Interpreting console output from the switch command

The switch command performs the equivalent of an update command after changing the module group. This will succeed as long as the dependencies can be satisfied from the new module group. If those dependencies are already available in the local repository, then the console output will be simple, such as:

Example console output for successful switch

C:\zeroapps\myapp>zero switch stable
CWPZT0600I: Command switch was successful

switch can also succeed by retrieving missing dependencies from the remote repository. The corresponding console output describes the operation, such as:

Example console output for successful switch:  Remote resolve required

C:\zeroapps\myapp>zero switch stable
Missing the following dependencies
missing zero:zero.resource:[1.0.0.0, 2.0.0.0[
CWPZT0511I: Resolving zero:zero.resource:[1.0.0.0, 2.0.0.0[
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.resource/zips/zero.resource-1.0.0.0.18449.zip
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.resource/zips/zero.resource-1.0.0.0.18449.zip.sha1
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.data/zips/zero.data-1.0.0.0.18444.zip
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.data/zips/zero.data-1.0.0.0.18444.zip.sha1
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/org.ap
ache.derby/derby/jars/derby-10.3.2.1.jar
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/org.ap
ache.derby/derby/jars/derby-10.3.2.1.jar.sha1
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.atom/zips/zero.atom-1.0.0.0.18290.zip
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.atom/zips/zero.atom-1.0.0.0.18290.zip.sha1
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.stax/zips/zero.stax-1.0.0.0.17647.zip
CWPZT0545I: Downloading https://www.projectzero.org/sMash/1.0.x/repo/base/zero/z
ero.stax/zips/zero.stax-1.0.0.0.17647.zip.sha1
Re-Resolve the ivy file C:\zero.apps\myapp10\config\ivy.xml
CWPZT0600I: Command switch was successful

switch fails if it's unable to obtain the dependencies. One cause of failure would be if the application used a not-yet-released module from the experimental module group. The console output indicates the problem and cancels the switch operation, such as:

Example console output for failed switch

C:\ZERO~1.APP\myapp10>zero switch stable
Missing the following dependencies
missing zero:zero.restdoc:[1.0.0.0, 2.0.0.0[
CWPZT0511I: Resolving zero:zero.restdoc:[1.0.0.0, 2.0.0.0[
CWPZT0808E: The resolve report has errors, the resolved properties will not be c
reated.
CWPZT0537W: Resolve could not find the following dependencies
        zero:zero.restdoc:[1.0.0.0, 2.0.0.0[
CWPZT0830E: The switch to modulegroup stable failed, the module will be restored
 to original modulegroup.
CWPZT0601E: Error: Command switch failed, use 'zero -logfile=cli.log ...' for mo
re detail

Version 1.1.0.0.19254