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 scripts.v2/migrate.js.

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!

Ref link

In order to initiate the migration process, you need to:

  1. Clone the api-management-developer-portal repository locally.

  2. Run npm install in the root of the project.

  3. Change directory (cd) into the scripts.v2 folder.

  4. Now run the portal command below with a valid combination of arguments.

    Managed Portal Command

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.

image.png Source Management API endpoint & SAS Token

image.png Destination Management API endpoint & SAS Token

image.png Destination Developer Portal URL

Be sure to substitute and input all the required parameters in the managed portal command on a note pad.

Execution

The command performs the following steps:

  1. Capture the portal content from the source API Management service (excl. media).

  2. Remove the portal content from the destination API Management service (incl. media).

  3. Upload the portal content to the destination API Management service (excl. media).

  4. Download the portal’s media files from the source API Management service.

  5. Upload the portal’s media files to the destination API Management service.

  6. (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.

Call to action

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

image.png

Once all the dependencies have been installed.

Then copy and run the managed portal command with a valid combination of arguments as seen below:

image.png

With that, be rest assured all contents (including media) have been migrated to the destination portal.

Post — Execution

image.png Source Developer Portal URL

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.

image.pngDestination Developer Portal only visible as administrator

Now Click on Operations then Publish Website

image.png

Voila! The published target APIM service developer portal publicly available to external visitors.

image.png Target APIM Service Developer Portal Publicly available to external visitors.

In conclusion, 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.

No Comments Yet