Software AG Products 10.11 | Integrate Software AG Products Using Digital Event Services | webMethods API Gateway Documentation | Upgrading API Gateway | Upgrading | Upgrading API Gateway in Zero Downtime | Migration of REST APIs
 
Migration of REST APIs
You must perform the operations in the migration of REST APIs capability in the new instance of API Gateway.
These APIs trigger a migration action and immediately returns a 202 status code which indicates that the migration request has been accepted. When the action is completed a webhook event with the migration status is sent to the subscribed webhook clients.
1. Clean API Data Store.
This action deletes the data from the API Data Store. You must invoke this API before invoking the reindex API for core indices.
POST /rest/apigateway/migration

{
"action": "clean"
}
Note:
As a measure of caution, by default this action takes a backup, prior to deleting the data. As a prerequisite, you must configure the path.repo property elasticsearch.yml file for the API Data Store to take a snapshot in that location. If the administrator deliberately wants to exclude the backup of data then add "backup": false in the payload.
2. Re-index API Data Store.
This action re-indexes the data from the old instance API Gateway's datastore to new instance API Gateway's datastore. The API to perform this action is as follows:
POST /rest/apigateway/migration

{
"action": "reindex",
"indicesType": "core/logsevents",
"sourceElasticsearch": {
"url": "http://remotehost:9240",
"username": "username",
"password": "password"
},
"properties": {
"apigateway.migration.srcTenantName": "default",
"apigateway.migration.batchSize": 100,
"apigateway.migration.logLevel": "info",
"apigateway.migration.reindex.status.check.sleep.interval": 5000,
"apigateway.migration.batchSize.gateway_{0}_apis": 50,
"apigateway.migration.batchSize.gateway_{0}_log": 100,
"apigateway.migration.batchSize.gateway_{0}_audit_auditlogs": 50,
"apigateway.migration.batchSize.gateway_{0}_analytics_transactionalevents": 50
}
}
The parameters used in the above API are described in the following table:
Parameter
Description
indicesType
Specifies the type of indices to be reindexed from the Elasticsearch of old instance API Gateway to Elasticsearch of new instance API Gateway. The possible values are core and logsevents. Core indices are used to store the design time assets like APIs, alias, configurations, and so on. Logsevents indices are used to store the logs and events like performance metrics, license metrics and logs.
sourceElasticsearch
The API Data Store details of old instance API Gateway.
properties
These migration properties can be used to specify the old instance API Gateway's tenant name and optimize the performance of reindex action. If not specified, the values from migration.properties file located at SAG\IntegrationAPI Gateway server\instances\default\packages\WmAPIGateway\bin\migrate are taken.
3. Transform API Data Store.
The transform action transforms the re-indexed assets in the new instance of API Data Store to ensure that it is compatible with the new API Gateway version. The API used to transform is as follows:
POST /rest/apigateway/migration

{
"action": "transform"
}
4. (Optional) Use the following API to check the migration action status.
GET /rest/apigateway/migration/status?action=[reindex | transform | clean]

{
"status": "success",
"failureReason": null
}