Blog > CPI content migration to Cloud Foundry environment – Part 1

CPI content migration to Cloud Foundry environment – Part 1

Katarzyna Wydro SAP Integration Consultant
icon__calendar 2020-08-26

Part 1

Migrate with Postman step-by-step

In this article you will learn:

  • How to migrate your SAP Cloud Platform Integration content from the Neo to Cloud Foundry Environment using pre-delivered Postman collections

In Part 2 – Test migration with Int4 IFTT  (the only tool on the market supporting SAP CPI Neo to SAP CPI Cloud Foundry migration testing) you will see how easily you can test your integration scenarios after migration and how to complete the process with necessary steps.

Check this out for complete migration process!

SAP Cloud Platform Integration on Cloud Foundry – a game worth playing

In recent months we can observe a thriving popularity of SAP Cloud Platform Integration in Cloud Foundry Environment. There are good reasons that Cloud Foundry environment is a recommended choice.

Cloud Foundry gives you competitive edge thanks to hosting provided by known cloud providers like Amazon, Alibaba, Google or Microsoft and data centers located in many regions.  You can also benefit from the improved availability of Cloud Foundry thanks to the concept of availability zones – meaning resources from various data centers can be shared in the zone boundary therefore improving their availability.

However, you should also get familiar with some limitations of this option available in SAP Note 2752867 before deciding to migrate.

How to migrate integration content from Neo to Cloud Foundry painlessly?

To perform the migration you can use the SAP Cloud Platform Integration OData API. It enables you to export and import integration content from source tenant to the target and deploy it.

Migration process is described in the SAP Note 2937549 – SAP Cloud Platform Integration for process services: Content Migration from Neo to CF Environment. The described approach is based on utilizing Postman tool for performing API calls. There are pre-delivered postman collections which call the APIs made available to you. You will find it in attachment to the before mentioned SAP Note.

The postman collections consist of requests, environment configuration and scripts which control the execution. They are executed before and after particular request. You don’t have to worry about configuring each request, all you have to do is to configure the environment in Postman and press run button.

However, to make the process reliable, you have to prepare accordingly.

Migration: big picture

Migration procedure can be divided into following phases:

  1. Analysis of the sender systems which communicate with your CPI tenant. After actual content migration you will have to adjust the endpoints in the sender systems (unless you’re using Custom Domains). This step also requires security artifacts identification (User Credentials, Certificate-to-User-Mappings) which will be required to successfully deploy runtime artifacts.
  2. Preparation of target Cloud Foundry tenant. In other words you need to provide new CPI multitenant application according the procedure relevant for your license agreement. This also includes user roles assignment.
  3. Actual content migration from Neo to Cloud Foundry environment. During this phase you will migrate and deploy the Integration Packages, Keystore contents and Number Ranges, if they exist.
  4. Post-processing and verification of migration results.

Note, that before migration you have to meet the following prerequisites:

  • ensure that SAP Pre-packaged content is in the most recent version (if not, it has to be updated). Otherwise migration is going to be aborted.
  • customer content have to be saved as version (no objects in draft state). Packages containing objects in draft state will be omitted.

Please consider, it’s recommended to perform activities mentioned in 3rd point in the downtime. It will prevent using source and target tenant in the same time what may lead to issues.

Migration step-by-step guide

Let’s move on to the details.

Download the file Migration.postman_collections.zip containing postman collections attached to the Note 2937549 and modify the file Credentials.postman_environment.json.

Provide the credentials (user name and password) of the user which will be utilized for the migration and the source and target tenant host URLs (without the http:// and /itspaces).  Note, that in this approach you need to use same credentials for source and target tenant user.

Change credentials


Import the collection into Postman

  • Press the “Import” button

Postman import button


You will see the placeholders for the source and target tenant in the requests. They will be populated with values configured in the Credentials environment (file Credentials.postman_environment.json).

Postman request placeholder


  • Select File or Folder tab and choose files or folder from your computer by pressing “Upload Files” or “Choose folder from your computer”

Postman import upload files dialog


  • Press “Import” button to finalize collection importing.

Postman import finish


You should see imported collections in the left pane and Credentials in the top:

Postman collections after import


Some requests have scripts assigned, which control the execution of requests. You can see them in Pre-request Script and Test tabs.

Postman scripts

Migrate design-time artifacts. Depending on your scenario use following collections:

  • SAP Pre-Package Content Migration – for migration of SAP Integration content
  • Custom Content Migration – for migration of your custom content (Integration Flows and OData Services)
  • Value Mapping Configurations – for migration of your Value Mappings

Collection execution step by step:

  • Press execution button near the collection name. You can also hit “runner” button on top.

Postman colleciton execute

  • Collection Runner window will pop-up
  • Select the “Credentials” for run environment

Postman select environment credentials

  • Press run button (with collection name)
  • You will see the request execution details with the response status codes.

Postman successfull run


You might see status error codes – for instance 400 when there is an attempt to upload artifact’s configuration which is not available. Also, the run might be aborted when you’ll try to migrate SAP content which is not in the recent version. In this case you will see errors in the log in the console as in the screenshot below.

Postman erroneus run

Migrate security contents

After you’ve migrated the Integration content you need to use collection Custom Certificate Management to copy keystore contents. Note, that in this step following artifacts will be migrated:

  • Certificate,
  • KeyPair.

Note, that migration of Security Material and Certificate-to-User-Mappings are not covered by this procedure. Before proceeding to next steps you have to make sure those materials are in place. There is no collection to handle this part, however there is an API method which enables addition of user credentials and Certificate-to-User-Mappings. You’ll find an exemplary request in the further section of this article.

Migrate Number Range Objects (optional)

At this stage you should have already migrated the SAP pre-delivered content, custom content and value mappings configurations. Now you have to migrate the number ranges as well, in case you’re using any. For this purpose use collection Number Range Object Migration.

Deploy integration artifacts

Once you have all the required content in place it’s time to deploy your integration artifacts by running Deploy Migrated Content collection. After completing this step ensure that all the Integration flows are in the “Started” state. It may happen some of them are erroneous, for instance if you’re missing user credentials. If there are errors you have to resolve them before proceeding to next steps.

Cpi manage integration content


In the screenshots below you can see the source tenant design tab contents:

CPI source design tab


And migrated content in the target tenant:

CPI target design tab


As you can see the “Created By” property and timestamp have been overwritten with the user name used for migration and migration date and time. Also, as mentioned, content might be missing, since packages containing objects in the Draft state are not migrated.

At this point all the required integration content is migrated into target tenant. Follow the next part of the blog to complete the process with post-processing steps and make sure migration was successful! I next part I’ll show you how to test your integration scenarios using Int4 IFTT which is the only tool in the market supporting migration of CPI integration content from Neo to Cloud Foundry environment. With low effort you can simply achieve certainty that your integration scenarios work as expected.

 

API call to add user credential in target tenant

The migration procedure described in the SAP Note does not cover this part. However, you can use the API method POST https://{{targetHost}}/api/v1/UserCredentials for this purpose with body containing credentials in JSON format. You need to:

  • First retrieve the CSRF token by sending request https://{{targetHost}}/api/v1/ with header X-CSRF-Token: Fetch

 

You will find the token in the bottom section:

Postman xsrf token

  • Send another request POST https://{{targetHost}}/api/v1/UserCredentials with two headers:

Content-type: application/json

X-Csrf-Token: value obtained in the previous request

Csrf token request

  • Replace the placeholders below with desired values and send the request with following body:



If the addition was successful you should see the result as below:

Postman user credentials


Let’s have a look at newly created credentials in the CPI target tenant:

CPI created credentials


In order to add Certificate-to-User-Mapping you can use POST request  https://{{targetHost}}/api/v1/CertificateUserMappings passing X-CSRF-token in header and body with following format:



You can refer for more details to SAP API Business Hub

 

Summary

In this blog you’ve gained essential insights into the process of migration of SAP Cloud Platform Integration content from Neo to Cloud Foundry Environment. In the next part of this blog, you will see how to incorporate Int4 IFTT to ensure your migration is successful.

 

Useful links:

Integration Content API in SAP API Business Hub

openSAP course on testing SAP CPI (week 3 – Unit 4: SAP Cloud Platform Integration Testing)

SAP Cloud Platform Integration OData API documentation

How to use postman collections

SAP Note

 

Katarzyna Wydro SAP Integration Consultant
SAP consultant since 2016. Involved in local and international projects in developer role. Certified in ABAP and SAP Cloud Platform Integration area.

Contact us

If for any reason, the thought of reaching out to us has crossed your mind, then by all means do not hesitate to get in touch with us, as we are more than happy to put to rest all of your concerns.