Migrating managed Developer portal between APIM services
The developer portal supports programmatic access to content. It allows you to extract the data from or upload it to your API Management service through the content management REST API
To simplify automation of this process, a script has been prepared for that purpose which is available here
It exports the content of the developer portal from one API Management service and imports it into the developer portal of another API Management service - for example, exports from a test environment and imports into the production environment.
Let’s get started!
In order to initiate the migration process, you need to:
- Clone the api-management-developer-portal repository locally.
2. `npm install` in the root of the project.
3. Change directory (cd) into the scripts folder.
3. Then run the script with a valid combination of arguments
Managed portal command example:
Pre — Execution
You need to provide the required parameters to run the script: source management API endpoints, destination management API endpoints, destination developer portal URL, source SAS token, destination SAS token.
Input all the required parameters in the managed portal command on a note pad.
The script performs the following steps:
- Capture the portal content from the source API Management service (excl. media)
- Remove the portal content from the destination API Management service (incl. media)
- Upload the portal content to the destination API Management service (excl. media)
- Download the portal’s media files from the source API Management service
- Upload the portal’s media files to the destination API Management service
- (Optional) If you’re using a managed portal, you can set the script to auto-publish the destination portal to make the migrated version automatically available to the visitors
Clone the repository which contains the source code of the developer portal locally.
From your command prompt, now cd into the cloned folder
run npm install
Once all the dependencies have been installed.
Then run the managed portal command with a valid combination of arguments as seen below
With that, be rest assured all contents (including media) have been migrated to the destination portal.
Post — Execution
After the script is successfully executed, the destination developer portal should contain the same content as the source developer portal.
Although you’ll be able to see it as an administrator, the script doesn’t publish the portal of the target service to external visitors.
You need to publish the portal through its administrative user interface bounded in red box. You can find instructions to do so here.
Now Click on Operations > Publish Website
Voila! The published target APIM service developer portal publicly available to external visitors.
We have been able to successfully export the content of the developer portal from one API Management service and imports it into another API Management service with this guide.
Feel free to let me know if this guide was helpful. I am available on Twitter.