This assumes you are familiar with the basic usage of the Gateway Migration Utility and that you are using an arguments file with an encoded password to connect to your API Gateway. This also assumes you have migrated out an entity (service, policy, folder) into an XML file named foo.xml.
When you migrateOut, the defaultAction can be NewOrExisting, NewOrUpdate, or Ignore, and the action you use will be in the XML file that is migrated out, like this.
If one of these three actions does not quite fit into your needs, then you can utilize the manageMappings command. With manageMappings, you have more fine tuned control over the action that will occur when the entity is migrated into the target environment. For example, you could use ForceNew to create a new entity in the target.
/path/to/GatewayMigrationUtility.sh manageMappings –bundle foo.xml -type "SERVICE" -action "ForceNew"
In this example, foo.xml is updated with the new mapping action.
Or Delete the entity in the target.
/path/to/GatewayMigrationUtility.sh manageMappings –bundle foo.xml -type "SERVICE" -action "Delete" -outputFile bar.xml
In this example, foo.xml is not changed. Instead, a new file (bar.xml) is created, and bar.xml contains the new mapping action.
Here are the possible actions with manageMappings.
|New||Create new entity. Fail if entity exists.|
|Update||Update existing entity. Fail if entity does not exist.|
|Existing||Use existing entity. Fail if entity does not exist.|
|ForceNew||Create new entity, using a new ID if necessary.|
|Delete||Delete an entity. Fail if entity does not exist.|
|Ignore||Ignore an entity regardless if entity exists or not.|
|NewOrUpdate||Update an existing entity. Create one if entity does not exist.|
|NewOrExisting||Use an existing entity. Create one if entity does not exist.|
|DeleteOrIgnore||Delete an entity. Ignore if it does not exist.|
After updating the mapping action, you are ready to migrate in.