Skip to main content

Import From Backstage

Port provides a simple script that can be used to import data from your Backstage instance using the Backstage API into Port in a single click. The script initializes the blueprints and entities in Port based on the data in your Backstage instance.

tip

The source code of the import script is open and available on GitHub

Prerequisitesโ€‹

  • Docker;
  • Port organization;
  • Backstage instance.

Usageโ€‹

  1. Clone the project repository repository:
git clone https://github.com/port-labs/backstage-import.git
  1. In the cloned repository, create a .env file with the following values:
BACKSTAGE_URL=<YOUR BACKSTAGE URL i.e https://demo.backstage.io>
PORT_CLIENT_ID=<YOUR PORT CLIENT ID>
PORT_CLIENT_SECRET=<YOUR PORT CLIENT SECRET>
  1. Run the import script:
./import.sh

Done! after the script completes, you will see the new blueprints in Port, along with entities matching the data you have in your Backstage instance.

Next Stepsโ€‹

Export to GitOpsโ€‹

Once all entities have been imported to Port, you will likely want to start managing them through specification files in Git.

To do this, click on the three-dot icon in the top right corner of the Port UI, then select "Export Data" from the menu, followed by "Export to GitOps." This will download all the specification files to your local machine.

You can then push them to your GitOps repository and begin managing them from there.

To learn more about managing your Port entities using GitOps, refer to the GitHub and Bitbucket GitOps pages.