Move classic AppServer code to PAS for OpenEdge

After merging your classic AppServer application properties to your PAS for OpenEdge instance, you are ready to move your application code. Follow these steps:

  1. Move your server code (not all connection types may be required for your application):
    1. Move ABL server code.
    2. Move WebSpeed server code.
    3. Move REST server code.
    4. Move SOAP server code.
  2. Test your database access.
  3. Start your PAS for OpenEdge instance.

Depending on your code base, you will need to complete some or all of the applicable sections to move your code to the proper transport. This tutorial demonstrates ABL client and application server code changes.

You can run your existing classic AppServer code from the current location, or you can take this opportunity to organize that code in the recommended application code and common code directories.

1. Move your server code

Move existing server code to these recommended locations to promote security, scalability, extensibility, and easier deployment:
  • For application code, move compiled code to instance-name/webapps/ROOT/WEB-INF/openedge.
  • For common code used by multiple applications, move compiled code to instance-name/openedge.

1a. Move ABL server code

Move your ABL server code to a location on your new PAS for OpenEdge instance. This example uses the sample code from the classicAppServerCode directory, but all the ABL server code can be accessed similarly.

This tutorial runs sample code using the ROOT (default) web application on a PAS for OpenEdge instance. You will move the server code to the instance-name/openedge directory.

  1. In the %WRKDIR%/classicAppServerCode directory, copy your ABL server code (ServerGetCustNameSample.p) to the instance-name/openedge directory. For example:
    proenv>cd %WRKDIR%\classicAppServerCode
    proenv>copy ServerGetCustNameSample.p %WRKDIR%\myProdInstance\openedge\
    Note: Review the ServerGetCustNameSample.p to ensure it references the same database name that your server will connect to. For OpenEdge 12, the database is sports2020.
  2. Verify that your instance-name/conf/openedge.properties includes the necessary entries in the agentStartupParam properties to reference your database.
    • If you are referencing the database directly, then ensure that the agentStartupParam database connection string points to the correct location of the database. For example:
      [AppServer.SessMgr.myProdInstance]
       agentStartupParam=-T "C:\OpenEdge\WRK\myProdInstance/temp" -db C:\OpenEdge\WRK\database\sports2020.db
    • If you are storing the database location in a .pf file, then ensure that the .pf file points to the correct location of the database. For example:
      proenv>oeprop.{sh|bat} AppServer.SessMgr.myProdInstance.agentStartupParam
      -T "C:\OpenEdge\WRK\myProdInstance/temp" -pf C:\OpenEdge\WRK\classicAppServerCode\databases.pf
      proenv>more %WRKDIR%\classicAppServerCode\databases.pf
       -db C:\OpenEdge\WRK\database\sports2020.db -H localhost
      Note: Ensure you have updated the database connections in the oemerge file (where required) as described in Prepare to move from Classic AppServer to PAS for OpenEdge, including copying the Sports2020 database to the %WRKDIR%\database directory using procopy.
Note: If you are moving a classic state-reset or state-aware application, you must configure special connect and disconnect event procedures. For more information, see Migrate classic AppServer operating modes.

1b. Move WebSpeed server code

Note: This step is not required if you are using the sample tutorial code. It is included as a reference for moving WebSpeed application code to PAS for OpenEdge.
  1. Move the static files (images and HTML pages), from your WebSpeed application to the instance-name/webapps/ROOT/static directory.
  2. Review the PROPATH entry in the instance-name/conf/openedge.properties file to make sure that it includes compiled code for your WebSpeed application.
  3. In the openedge.properties file, set the defaultHandler property to OpenEdge.Web.CompatibilityHandler. For example:
    [myProdInstance.ROOT.WEB]
     defaultHandler=OpenEdge.Web.CompatibilityHandler
  4. If you modified your web-disp.p, you must make similar changes to the default web-handler.p.
    Note: PAS for OpenEdge does not support applications with HTML Mapped Web Objects.

For more information about WebSpeed code, see Migrate Classic WebSpeed Applications.

1c. Move REST server code

Note: This step can be performed using the sample tutorial code, but is not required if are not migrating classic AppServer REST services to PAS for OpenEdge. It is included as a reference for moving REST application code to PAS for OpenEdge.

A classic AppServer REST application .war or .zip file cannot be deployed to PAS for OpenEdge. If you have a classic AppServer REST application .war, then unzip the archive and deploy the application .paar file, or export the file from Progress Developer Studio for OpenEdge.

  1. Copy the code that supports the REST interface API into the directory: instance-name/webapps/ROOT/WEB-INF/openedge. For example:
    proenv>cd %WRKDIR%\classicAppServerCode\classicREST
    proenv>copy getCustomer.p %WRKDIR%\myProdInstance\ROOT\WEB-INF\openedge
    proenv>copy getAllCustomers.p %WRKDIR%\myProdInstance\ROOT\WEB-INF\openedge
    
    Note: The sample tutorial files support the following REST service resources:
    • /classicRESTService/customers
    • /classicRESTService/customers/{custId}
  2. Navigate to instance-name/bin. For example:
    proenv>cd %WRKDIR%\myProdInstance\bin
  3. Run the deployREST command with the path to the .paar file and the name of the ABL web application. For example:
    proenv>deployREST %WRKDIR%\classicAppServerCode\classicREST\classicRESTService.paar ROOT
  4. Update database connections as necessary in the agentStartupParam in the instance-name/conf/openedge.properties file, and ensure that database is running.
  5. In the openedge.properties file, enable the REST transport for the ABL web application that supports the REST service. For example, if the ROOT application supports the REST service, set the following property:
    [myProdInstance.ROOT.REST]    
        adapterEnabled=1
  6. When the PAS for OpenEdge is running, test the REST service connections with the following URLs:
    http://hostname:port/rest/classicRESTService/customers
    http://hostname:port/rest/classicRESTService/customers/3005
    Note: The 3005 is a customer ID in the Sports2020 database that is included with OpenEdge 12. If you are using the Sports2000 database, use 1 as the customer ID. Additionally, if you are deploying to an ABL web application that is different from ROOT, include the ABL web application name in the URL before the /rest segment. For example: http://localhost:8817/ablwebapp_name/rest/classicRESTService/customers

The deployREST command supports additional REST service descriptors other than .paar files, including .zip files that contain mobile catalog files (or other static files).

Note: Do not deploy the REST Manager (oerm.war) with PAS for OpenEdge because the supporting files are already included in the server.

For more information about deployREST, see Deploy REST services.

1d. Move SOAP server code

Note: This step is not required if you are using the sample tutorial code. It is included as a reference for moving SOAP application code to PAS for OpenEdge.

The Web Service Adapters (WSA) are not required for SOAP clients. PAS for OpenEdge includes the necessary SOAP transport support.

  1. Copy the code that supports the SOAP interface API into one of the PROPATH locations.
  2. Go to instance-name/bin.
  3. Run deploySOAP.{sh|bat} source_descriptor ROOT

    Where:

    source_descriptor

    Specify the path of the source descriptor, which is a WSM file.

    service_name

    Specify the target service name.

For more information about deploySOAP, see Deploy SOAP services.

2. Test your database access

Before you start your PAS for OpenEdge instance, ensure the database server is running.

  1. Using Proenv, start the database server using the proserve command, if it isn’t already running. For example:
    proserve %WRKDIR%\database\sports2020

    The database has successfully started when you see the Multi-user session begin and Login by messages.

  2. Confirm that the agentStartupParam property in your instance-name/conf/openedge.properties file correctly references your database server.
    • If your openedge.properties references the database connection string directly, ensure you have the correct absolute path. For example:
      [AppServer.SessMgr.myProdInstance]
       agentStartupParam=-T "C:\OpenEdge\WRK\myProdInstance/temp" -db C:\OpenEdge\WRK\database\sports2020.db
    • If your openedge.properties references the database connection string through a .pf file, ensure the .pf file contains the correct absolute path. For example:
      proenv>oeprop.{sh|bat} AppServer.SessMgr.myProdInstance.agentStartupParam
      -T "C:\OpenEdge\WRK\myProdInstance/temp" -pf C:\OpenEdge\WRK\classicAppServerCode\databases.pf
      proenv>more %WRKDIR%\classicAppServerCode\databases.pf
       -db C:\OpenEdge\WRK\database\sports2020.db -H localhost

3. Start your PAS for OpenEdge instance

Before you test client connections, test the server startup procedure and database connectivity. In this step, start or restart the server to confirm that the startup procedures are available and the .pf file connections are working.

  1. To start the instance, run pasman pasoestart. This loads your new openedge.properties file which enables the APSV transport on your production instance, a setting which is disabled by default on a new production instance.
    pasman.{sh|bat} pasoestart -restart -I myProdInstance
    Where:

    -restart

    If the instance is already running or is in a hung state, attempt to stop it, and then execute a full start up. If the instance is already in the stopped state, this option has no effect.

    -I

    Specifies the instance name.

    media/image18.png
  2. View the application agent log file in a text editor to ensure that the agent started correctly and to see if your startup procedure ran.
    The agent log file can be viewed in instance-name/logs/application-name.agent.date.log. The agent log file should contain these types of entries indicate that agent startup, database connection, and execution of the startup procedure were successful:
    2019-10-04T14:09:54.939-0400 027876 010356 1 AS-Aux-0 mtapsv:-:? MSAS Agent Starting Up -- Progress OpenEdge Release 12.1  build 1135.
    
    2019-10-04T14:09:55.034-0400 027876 018972 2 AS-ResourceMgr mtapsv:-:? CONN           Connected to database sports2020, user number 5. (9543)
    
    2019-10-04T14:09:55.145-0400 027876 024664 1 AS-4 ?:?:? -- (Procedure: 'session_startup.p' Line:24) This is a session startup event procedure!

Troubleshooting tips:

  • Review logs in the instance-name/logs directory for startup errors. The instance-name.agent.{date}.log file provides information about application agent connections, including database connectivity notifications.
  • Recheck the recommendations in the openedge.properties file that were imported from the oemerge file.
  • Confirm that the .pf file has the correct path to the database.
  • Confirm that the event procedures are available in the PROPATH.