WSO2 API Manager 2.0.0 onwards, there is a tool to migrate APIs between environments. Unfortunately, this tool will export/import only one API at a time. While I’m working with different customers, I have noticed that migrating APIs between environments is not an easy task if there so many APIs in the environment. So I have written a tool, which will migrate all the APIs available in the given source environment to another environment.
Prerequisites
- WSO2 API Manager environments (both environments must be up and running)
- Migration tool [download]
- A client computer with Java 1.8.0 or higher (which has access to both WSO2 API Manager environments)
Getting Started
- Configure the API Manager instances as mentioned in Deploy the API import/export tool section in [1]. Please note that refer that relevant documentation since there is a matching import export tool for each API Manager release.
- Once you deploy the war file, <API_HOME>/repository/deployment/server/webapps should have following folders.
- We are interested in following web apps and we will have to use version numbers from these folders while running the migration tool. Please note that version numbers might be different in your case so please change accordingly.
- client-registration#v0.10 (client-registration/v0.10)
- api#am#publisher#v0.10 (api/am/publisher/v0.10)
- api-import-export-2.0.0–v4
Migrating the APIs
- Open a command line and execute the following from the place where you have the migration tool.
java -jar api-migration-tool.jar
- Enter the parameter values accordingly and configure the tool. Once the configuration is done, the tool will migrate all the APIs or given API between the environments. Please look at the sample given below.
References
[1] https://docs.wso2.com/display/AM250/Migrating+the+APIs+and+Applications+to+a+Different+Environment