Mobile Services Migration from NEO to CF
Before going through the migration journey, understand why do you need to move from NEO to CF using this detailed guide Migrate from SAP CP NEO to SAP CP CF .
For the Mobile Services a migration guide is available in the official help documentation .
In this blog I’ll focus on moving an android mobile application deployed on NEO environment to CF environment.
Below are the prerequisites
- Get a Trial Account for SAP Cloud Platform – Link (if you already have one skip this step)
- Enable Mobile Services (Follow only step 1. There are 2 tabs, one each for CF and NEO)
- For our application we would get the data from SAP Gateway Demo Server, which in our case is an ES5 backend system. In case if you do not have an account for ES5 system, here is the link to create one.
- Install Android Studio
- Install latest version of SAP Cloud Platform SDK for Android – link
As the first step lets create an application config in our NEO environment
- Go to mobile services cockpit, click on “Mobile Applications” and select “Native/Hybrid”
- On click of New button, a popup to create a new application is displayed.
- From the config templates select Native.
- Give a meaningful ID (com.sap.migration.demo)
- Enter the application name.
- Description and vendor are optional.
- Click Save.
- Once the app is created, on the Assigned features tab click on connectivity. Since it’s a new application, there would not be any destination assigned to the application. Click on create button.
The application configuration is complete, now let’s go ahead and create an app on android studio.
- Open Android Studio and choose Start a new SAP Cloud Platform Android project.The wizard can save the server connection details for multiple servers. Fill in the required fields as shown below.
Account Name NEO mobile services Admin API URL See below for how to get this URL Admin UI URL See below for how to get this URL Authentication Type Basic Username Username for your cloud platform account Password Password for your cloud platform account Save Account Information Check this so that you do not have to re-enter account information on subsequent runs of the wizard
To fetch the Admin URLs go to the Important links section in the SAP CP Mobile Services website.
- Click Next on the Server connection tab. In the Use Existing tab, from the Application ID list, you should be able to see the app which was created in the mobile services tenant. Select the app and click Next.
- Android Studio creates an application and launches the source code. Wait for the build to finish and choose an emulator / device for running the app. When the app launches on the emulator the list of OData entities are listed.
- Now you must recreate the application configuration on CF. To do this you must go back to Mobile Services Neo cockpit and select the app. Once you’re in the app configuration view, click on Export.
- The configuration zip file is saved in your system. Now open the Mobile Services CF tenant and select the Mobile Applications – > Native / Hybrid form the navigation view. Click on Import and select the config file downloaded in above step.
- Once the app is imported into CF, have a look at the application to see that the app configurations are retained in CF as well.
- Finally, the mobile application must be adjusted to connect to the Cloud Foundry environment. Usually it is enough to change the target URL in the application, but there may be changes necessary to reflect differences in the security setup.
- In order to change the target URL, expand the application in Android Studio and look for configurationprovider.json file. Currently the server URL points to Neo. Change the URL to CF application.
- Go back to the CF Mobile Services tenant and click on the application imported. On the main view of the app click on the API’s tab. Under the API section in the page, you would find the server URL. Copy the server URL and replace it in configuraitonprovider.json file. Remember to have slash (/) at the end.
- Re-run the application and you would see the app is pointing to CF.
Now you have android application secured with SAML based authentication having ES5 system as backend system migrated to SAP CP running on CF with minimal number of steps.