Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Migrate portal between services

Mike Budzynski edited this page Oct 30, 2019 · 10 revisions

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, we've prepared the scripts/migrate.bat script. It exports the content of the portal from one API Management service and imports it into another API Management service - for example, exports from a test environment and imports into the production environment.

The subsections below describe how to setup the script, what actions it performs, and what to do after it's executed.

Pre-execution - configure

You need to provide the required parameters to run the script: management API endpoints, SAS tokens, and Storage Account connection strings for both source and target API Management services.

If a portal is self-hosted, provide the connection string of the Storage Account specified in the config.design.json file. If a portal is managed, refer to this article for instructions on retrieving the connection string.

WARNING: consider performing a backup of the target service's content before running the script. The script removes all the content from the target service.

Execution - run

The script performs the following steps:

  1. Capture the content of the source portal (excl. media)
  2. Remove all the content of the target portal (incl. media)
  3. Upload the content of the source portal to the target portal (excl. media)
  4. Download the media files from the source portal
  5. Upload the media files to the target portal

Post-execution - publish

After the script is successfully executed, the target API Management service should contain the same portal content as the source service. 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.

If the portal of the target service is managed, you need to publish the portal through its administrative user interface. You can find the instructions in the Azure documentation - Access and customize the managed developer portal in Azure API Management tutorial.

If the portal of the target service is self-hosted, you need to follow the publishing and hosting instructions from the general self-hosted portal tutorial.