GitHub Enterprise Importer

GitHub Enterprise Importer (formerly Octoshift) has been in public beta for some time and many organisations looking to migrate to GitHub Enterprise Cloud or GitHub.com have already been using this tool, so it has been well tested ready for General Availability. Now officially launched by GitHub, it is ready to start migrating your source code.

Microsoft is now focusing on GitHub.com being the way forward for code management, so it makes sense to start moving repositories away from Azure DevOps and bring all code sources into one location. GitHub Enterprise Importer (GEI) enables you to plan and perform self-serve migrations from CLI or through API without losing any of the collaboration attributes. This means you can keep the context of changes to your code, helping to preserve knowledge over time. And it’s not just Azure DevOps it supports, you can bring in GitHub Enterprise Server, Bitbucket Data Center, Bitbucket Server, or other GitHub.com repos if you want to adopt Enterprise Managed users on those repos.

The main attraction of this importer is the simple CLI tool, installable as an extension to the existing GitHub CLI. With the average time of migrating a repo just 70 seconds, this is built to handle bulk migrations and provides feedback on errors, warnings, and updates to ensure you don’t miss any important source data.

To give you an idea of exactly how simple it is, let’s run through the steps it takes to migrate a single Azure DevOps (ADO) repo into GitHub.com

This assumes you have GitHub CLI installed but if you don’t you can find the latest install here: GitHub CLI

  1. Install the GEI CLI. There are 2 separate ones, with one being specific to migration from ADO and this is the one used here. Simply run the following command
gh extension install github/gh-ado2gh
  1. Create Personal Access Tokens (PATs) with access to the ADO org and the GitHub org. Your ADO PAT must have work item (read), code (read), and identity (read) scopes in your ADO org. Your GitHub PAT must have repo (full), admin:org, and workflow (fullSet the ADO_PAT and GH_PAT environment variables

From the GH CLI, ensuring you are in the directory you installed the GEI to:

export ADO_PAT=<paste ADO PAT token here>

export GH_PAT=<paste GH PAT token here>
  1. Run the generate-script command to generate your PowerShell migration script
gh gei generate-script –-github-source-org ORGNAME --github-target-org orgname
  1. This will generate migrate.ps1 which can then be run from your locally installed PowerShell If you don’t already have PowerShell you can install that from here

That’s it! the PS script will migrate the content from ADO to GitHub and depending on the size is likely to take a minute or two to complete. Now obviously migrating years of projects will be more complex and certainly require planning. Fortunately GitHub have also put together a new planning guide which can help you run through all the steps needed.

For further reading on the currently supported GitHub migration paths, head to the documentation here. If you are looking at migrating from Bitbucket, register for the beta program and early next year you should see Bamboo join the party too.

Read more recent blogs

Get started on the right path to cloud success today. Our Crew are standing by to answer your questions and get you up and running.