+

Search Tips | Advanced Search

For up-to-date product documentation, see the IBM MobileFirst Foundation Developer Center.


Transfer an application configuration with the administration service

As an administrator, we can transfer an application configuration from one server to another by using the administration service of MobileFirst Server. No access to the application code is required, but the client app must be built for the target server.


Before you begin

You download the application descriptor from the server where the application is configured and you deploy it to the new server. We can see the application descriptor with MobileFirst Operations Console.


Procedure

  1. Optional: Review the application descriptor in the server where the application server is configured.

    Open the MobileFirst Operations Console for that server, select your application version, and go to the tab Configuration Files.

  2. Download the application descriptor from the server where the application is configured. We can download it by using the REST API or mfpadm.

    Note: We can also export an application or application version from the MobileFirst Operations Console. See Exporting and importing applications and adapters from the MobileFirst Operations Console.

    • To download the application descriptor with the REST API, use the Application Descriptor (GET) REST API.

      The following URL returns the application descriptor for the application of app ID my.test.application, for the ios platform, and version 0.0.1. The call is made to MobileFirst Development Server.

      http://localhost:9080/mfpadmin/management-apis/2.0/runtimes/mfp/applications/my.test.application/ios/0.0.1/descriptor

      For example, we can use such URL with a tool like curl.

        curl -user admin:admin http://[...]/ios/0.0.1/descriptor > desc.json

      Change the following elements of the URL according to our server configuration:

      • 9080 is the HTTP port of MobileFirst Development Server.
      • mfpadmin is the context root of the administration service. This context root is mfpadmin in MobileFirst Development Server.

      For information about the REST API, see REST API for the MobileFirst Server administration service.

    • Download the application descriptor by using mfpadm.

      The mfpadm program is installed when you run the MobileFirst Server installer. You start it from the product_install_dir/shortcuts/ directory, where product_install_dir indicates the installation directory of MobileFirst Server.

      The following example creates a password file, which is required by the mfpadm command, then downloads the application descriptor for the application of app ID my.test.application, for the ios platform, and version 0.0.1. The provided URL is the HTTPS URL of MobileFirst Development Server.

         
        prompt> echo password=admin > password.txt
        prompt> mfpadm --url https://localhost:9443/mfpadmin --secure false --user admin \
                --passwordfile password.txt \
                app version mfp my.test.application ios 0.0.1 get descriptor > desc.json
        prompt> rm password.txt

      Change the following elements of the command line according to our server configuration:

      • 9443 is the HTTPS port of MobileFirst Development Server.
      • mfpadmin is the context root of the administration service. This context root is mfpadmin in MobileFirst Development Server.
      • --secure false indicates that the server's SSL certificate is accepted even if self-signed or if created for a different host name from the server's host name used in the URL.

      For more information about the mfpadm program, see Administering MobileFirst applications through the command line.

  3. Upload the application descriptor to the new server to register the app or update its configuration.

    We can upload it by using the REST API or mfpadm.

    • To upload the application descriptor with the REST API, use the Application (POST) REST API.

      The following URL uploads the application descriptor to the mfp runtime. You send a POST request, and the payload is the JSON application descriptor. The call in this example is made to server that runs on the local computer and that is configured with an HTTP port set to 9081.

      http://localhost:9081/mfpadmin/management-apis/2.0/runtimes/mfp/applications/

      For example, we can use such URL with a tool like curl.

         curl -H "Content-Type: application/json" -X POST -d @desc.json -u admin:admin \
                  http://localhost:9081/mfpadmin/management-apis/2.0/runtimes/mfp/applications/

    • Upload the application descriptor by using mfpadm.

      The following example creates a password file, which is required by the mfpadm command, then uploads the application descriptor for the application of app ID my.test.application, for the ios platform, and version 0.0.1. The provided URL is the HTTPS URL of a server that runs on the local computer but is configured with an HTTPS port set to 9444, and for a runtime named mfp.

         
        prompt> echo password=admin > password.txt
        prompt> mfpadm --url https://localhost:9444/mfpadmin --secure false --user admin \
                --passwordfile password.txt \
                deploy app mfp desc.json 
        prompt> rm password.txt

Parent topic: Transfer server-side artifacts to a test or production server