Identify the MobileFirst WAR file and prepare the Ant deployment script

In this task, you identify the MobileFirst project WAR file that contains numerous resources and configuration settings for MobileFirst Server and prepare the Ant script that is used to deploy it.

About this task

The MobileFirst project WAR file, also referred to as the MobileFirst runtime environment, is a web application archive that contains server-specific configuration settings, and other resources that can be required to run MobileFirst applications and adapters. You produce this file with MobileFirst Studio, or IBM MobileFirst™ Platform Command Line Interface, and it is the end point for mobile applications. Read from the following tables whether this step is required for your upgrade path and what the system status is afterward if both Application Center and MobileFirst Server are on the same application.
Table 1. Is this step required for your upgrade path?
Product or component versions Required?
Worklight Server V5.0.6.x to MobileFirst Server V7.1.0 Yes
Worklight Server V6.0.x to MobileFirst Server V7.1.0 Yes
Worklight Server V6.1.x to MobileFirst Server V7.1.0.x Yes
Worklight Server V6.2.x to MobileFirst Server V7.1.0 Yes
MobileFirst Server V6.3.x to MobileFirst Server V7.1.0 Yes
MobileFirst Server V7.0.0 to MobileFirst Server V7.1.0 Yes
V7.1.0 to V7.1.0.x (fix pack or interim fix) Yes
Table 2. System status after this step
Module Status
Application Center Running
MobileFirst Server Running

Procedure

In the upgrade process, the MobileFirst runtime environment must be migrated, and redeployed to the application server. It is important to deploy the same WAR file than the one you previously deployed to your production server. This WAR file might have been updated since the last installation of MobileFirst Server, or the last upgrade. To ensure this, you must complete the following steps:
  1. Find the WAR file that was previously deployed to the application server.
    • If you are upgrading from Worklight Server V6.0.0.x or later, find the JNDI properties that were set for the deployed Worklight project to override the default worklight.properties file. If you used an Ant script with the configureapplicationserver task to deploy the WAR file, you can find in that script the JNDI properties that were set at installation time. For more information, see Configuration of MobileFirst applications on the server.

      For upgrading from Worklight Server V6.0.0.x or later, the procedure to deploy the WAR file is described at Deploying the project WAR file.

    • When you upgrade from Worklight Server V5.0.6.x, a MobileFirst WAR file is installed by the installer. If you have not modified this WAR file on your production server, you must create a modified file by following the instructions at Building a project WAR file with Ant.

      When you modify the WAR file, use Worklight Studio V5.0.6.x or the Ant tasks (worklight-ant.jar) from an installation of Worklight Studio V5.0.6.x that was used to build the apps previously deployed to the server. The version of Worklight Studio that was used to build the project WAR file must exactly match the version of Worklight Studio that was used to build the apps previously deployed to the server.

      The WAR file is automatically migrated to MobileFirst Server V7.1.0 format during the deployment procedure that is described in later steps.

  2. Prepare the Ant deployment script that you use to upgrade this WAR file to MobileFirst Server V7.1.0 and to deploy this WAR file to the application server, with the upgraded MobileFirst runtime library.
    1. Depending on the version from which you want to upgrade to V7.1.0, you must select one of the following options to prepare your Ant tasks.
      • Use the Ant samples provided in the WorklightServer/configuration-samples/ directory of the MobileFirst Server V7.1.0 distribution. Compared to previous versions, these Ant tasks do not install or upgrade the deprecated reports database. This method is preferred when you upgrade from V5.0.6.x, V6.0.0 or V6.1.0, when you do not want to upgrade your reports database, or if you cannot find the Ant tasks you used to install previous versions.
      • Reuse the Ant files that you used to install previous versions. The Ant files provided by previous versions do install and upgrade the reports database. This method is preferred when you upgrade from V6.2.0, V6.3.0, or V7.0.0, and you want to keep you reports database. You cannot use this method if you upgrade from V6.0.0 or V6.1.0, because the Ant tasks that are provided in these versions are not compatible with MobileFirst Server V7.1.0.

        If you upgrade from V6.0.0 to V6.1.0, you can encounter the following incompatibilities: The name of the worklight-ant-deployer.jar file is modified (taskdef element), and new targets are added to perform an upgrade without losing configuration (minimal-update).

        If you upgrade from V6.1.0 to V6.2.0, you can encounter the following incompatibilities: New targets are added to install the MobileFirst Administration Services, the MobileFirst Operations Console, and their databases. A new element is added to the configuredatabase task.

    2. To use a sample ant file that is provided in the WorklightServer/configuration-samples/ directory:
      1. You must install MobileFirst Server V7.1.0 on your computer, without installing Application Center.
      2. Review the sample configuration files in Sample configuration files, and copy the Ant sample file that corresponds to your application server and your database. For more information, see the table Sample configuration files provided with IBM MobileFirst Platform Foundation.
      3. There are two different cases, depending on the version to be upgraded:
        • For an upgrade from V6.0.0 and later, the files for upgrading your runtime and your database are named after the following pattern:
          configure-appServer-database.xml
        • For an upgrade from V5.0.6.x, the files for upgrading your runtime and your database are named after the following pattern:
          redeploy506-appServer-database.xml
          Note: These files have some parameters that are already entered to match the installation settings of IBM® Installation Manager for IBM Worklight V5.0.6, especially for the database settings.
    3. You find the following kind of properties in your configuration sample file:
      <property name= "database.db2.wladmin.password" value= "************" />
      <propertyname="database.db2.worklight.password"value="************"/>
      <property name= "worklight.server.install.dir" value= "****UPDATE**** - MobileFirst Server installation directory (example: /opt/IBM/MobileFirst_Platform_Server)" />
      <property name= "worklight.project.war.file" value= "****UPDATE**** - MobileFirst Project WAR file (example: /home/user/worklight.war)" />
      <property name= "worklight.contextroot" value= "****UPDATE**** - Context Root for the MobileFirst runtime environment (example: /worklight)" />
      <property name= "database.db2.host" value= "****UPDATE**** - DB2 host name (example: proddb.example.com)" />
      <property name= "database.db2.port" value= "****UPDATE**** - DB2 port, by default 50000 (example: 50000)" />
      <property name= "database.db2.instance" value= "****UPDATE**** - DB2 database instance (example: DB2)" />
      <property name= "database.db2.driver.dir" value= "****UPDATE**** - DB2 JDBC driver directory (example: /opt/database-drivers/db2-9.7)" />
      <property name= "database.db2.wladmin.dbname" value= "****UPDATE**** - Database name for MobileFirst Administration Services (example: WRKLGHT)" />
      <property name= "database.db2.wladmin.schema" value= "****UPDATE**** - Database schema for MobileFirst Administration Services (example: WLADMIN)" />
      <property name= "database.db2.wladmin.username" value= "****UPDATE**** - DB2 user name (example: wluser)" />
      <property name= "database.db2.worklight.dbname" value= "****UPDATE**** - Database name for MobileFirst runtime (example: WRKLGHT)" />
      <property name= "database.db2.worklight.schema" value= "****UPDATE**** - Database schema for MobileFirst runtime (example: WRKLGHT)" />
      <property name= "database.db2.worklight.username" value= "****UPDATE**** - DB2 user name (example: wluser)" />
      <property name= "appserver.was.installdir" value= "****UPDATE**** - Installation directory of IBM WebSphere Application Server Liberty profile (example: /opt/IBM/WebSphere/Liberty)" />
      <property name= "appserver.was85liberty.serverInstance" value= "****UPDATE**** - The name of the Liberty server (example: server1)" />
      You must specify precisely the values of these properties. For example, for the property named "worklight.server.install.dir", you must replace the following string with the actual directory where you installed MobileFirst Server:
      "****UPDATE**** - MobileFirst Server installation directory (example: /opt/IBM/MobileFirst_Platform_Server)"
      For passwords, such as "database.db2.wladmin.password", if you do not specify them in the Ant sample, then you are asked to enter them when it is required by the upgrading process.
      Note: The properties in the previous example are for WebSphere® Application Server Liberty profile, and DB2® database. For a different application server, or a different database, you have different properties to set.
      If you are not familiar with the MobileFirst component, the meaning of the properties is as follows:
      • the MobileFirst project WAR file is a WAR file that is built by your development team with MobileFirst Studio, or with MobileFirst Platform Command Line Interface.
      • The database for the Administration Services is a database that was introduced in V6.2.0, which contains applications, adapters, and other administration data. If you upgrade from V6.2.0 or later, you must use the same parameters as the ones you used at installation time, so that the upgrade is performed. If you upgrade from V6.1.0 or earlier, a new database must be created. For more information about the creation of this database, see Installation or upgrade of MobileFirst Server Administration Services.
      • The database for the MobileFirst runtime environment is a database used by the MobileFirst project WAR file. Use the same parameters as the ones you used at installation time, so that the upgrade is performed.

      Since V7.1.0, the Ant samples that are provided do not upgrade your reports database. If you still need to keep your reports database, and you want to upgrade it to V7.1.0, you must do extra customization of the Ant sample, in addition to the modification performed in this step. For more information, see Using Ant tasks to upgrade the reports database.

  3. Verify that the environmentID attribute for the MobileFirst runtime environments matches the environmentID attribute that is used to install the MobileFirst Server administration Ant file.

    If you install the MobileFirst Server administration components with a different Ant file than the one that you used to install the MobileFirst runtime environment, for example if you install the MobileFirst Server administration with the Server Configuration Tool, you might have a different environmentId for the administration and the runtime. In this case, the MobileFirst Server administration components would not find the MobileFirst runtime environments.

    The environmentID is an attribute of the following Ant tasks: