Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Azure DevOps Services
Before you use ELM, ensure the following requirements are met across Azure DevOps Services and GitHub Enterprise Cloud with data residency.
Note
Prerequisite setup uses both the Azure DevOps portal and GitHub UI (for one-time tasks such as creating a service connection, registering an agent, and creating a PAT) and the command line (for installing tooling). Each section is labeled so you know where to work.
Source and target repository requirements
- The migration must originate from Azure DevOps Services (
dev.azure.com). Azure DevOps Server isn't supported. - A target GitHub Enterprise Cloud with data residency organization must already exist.
- The target GitHub repository name must not be in use.
To get the Azure DevOps repository GUID, use either method:
Azure DevOps CLI (recommended):
az repos show --repository <repo-name> --query id -o tsvThe command returns the repository GUID. Save it for use when you start the migration.
Azure DevOps portal:
- In your Azure DevOps project, go to Project Settings > Repositories.
- Select the repository you want to migrate.
- In the browser address bar, copy the GUID that appears after
repositoryId=. It looks likexxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. Save it for use when you start the migration.
Access requirements
Azure DevOps Services
- You must have the Enterprise Live Migrations: Manage Migrations permission set to Allow at the repository level. To check, go to Project Settings > Repositories > Security and confirm your group or user account has this permission. If you don't, contact your Project Collection Administrator (PCA) or Project Administrator (PA) to request access. For more information, see Set Git repository permissions.
- If no self-hosted Linux agent is available, a PCA or someone with permission to administer the agent queue must create and register one.
- A user with the appropriate permissions must create the service connection that uses the GitHub PAT.
GitHub Enterprise Cloud with Data Residency
- A GitHub Enterprise admin must create the personal access token (PAT) and be able to create a service connection in Azure DevOps. The admin then shares the service connection ID with the person running the migration.
Authentication setup
Create a PAT in GitHub, then store it in an Azure DevOps service connection.
Create a PAT in GitHub (GitHub portal)
In GitHub, go to Settings > Developer Settings and select Personal access tokens.
As a GitHub Enterprise admin, create a classic PAT with the following permissions:
repo(all)workflowread:orgread:useradmin:enterprise(all)
Copy the PAT and store it securely.
Select Configure SSO to grant the PAT access to the target organization.
Create the service connection in Azure DevOps (Azure DevOps portal)
- Sign in to your Azure DevOps organization.
- Go to Project Settings > Pipelines > Service connections.
- Select New service connection, choose GitHub Enterprise Server, and then select Next.
- For Authentication method, select Personal Access Token.
- Enter the GitHub Enterprise URL and paste the GitHub PAT from the previous procedure.
- Verify and save the service connection.
- Open the service connection and copy the ID. You need this ID when you start the migration.
For more information, see Service connections in Azure Pipelines.
Required tooling
The steps in this section use the command line. Install the Azure CLI and the Azure DevOps CLI extension on the machine you use to run migration commands.
Install the Azure CLI. For more information, see How to install the Azure CLI.
For example, open Visual Studio Code and run:
winget install -e --id Microsoft.AzureCLIInstall the Azure DevOps CLI extension. For more information, see Get started with Azure DevOps CLI:
az extension add -n azure-devopsThe
az devops migrationscommands ship as part of the standardazure-devopsextension. There's no separate ELM extension to install.Verify the extension is loaded:
az devops migrations --helpTo update an existing installation:
az extension update -n azure-devops(Recommended) Set your Azure DevOps organization as the default so every
migrationscommand targets the right host:az devops configure --defaults organization=https://dev.azure.com/<org>If you skip this step and run commands from a folder whose
gitremote points to a different organization, the CLI's auto-detection picks that remote instead of your--orgvalue. To force it off for a single command, add--detect false.
Configure a self-hosted Linux agent
Use the Azure DevOps portal to select or create an agent pool, and then run the agent setup scripts on a Linux machine.
In Project Settings, go to Agent pools under Pipelines, choose the pool you want to use for the migration, and save the pool name.
If you don't have a pool to use, create a self-hosted Linux agent. For more information, see Deploy an Azure Pipelines agent on Linux. The short version:
- Confirm that you have permission to register an agent. If you're a PCA, you already have this access.
- In your Azure DevOps organization settings, go to Pipelines > Agent pools.
- Select the Default pool or your self-hosted pool.
- Open the Agents tab and select New agent.
- In the Get the agent dialog, select Linux and download the agent.
- On your Linux machine, unpack the agent into the directory of your choice and change to that directory.
- Run
./config.shand then./run.sh.
Important
You must use a Linux-based agent. Windows-based and macOS-based agents aren't supported.
Values to collect
Use this checklist to collect the values you need before you start the migration.
| Field | Example | Your value |
|---|---|---|
| Azure DevOps organization URL | https://dev.azure.com/myorg |
|
| Azure DevOps project name | MyProject |
|
| Azure DevOps repository name | my-repo |
|
| Azure DevOps repository GUID | xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx |
|
| Target GitHub organization URL | https://contoso.ghe.com/MyOrg |
|
| Target repository name | MyProject-MyRepo |
|
| Service connection ID | cd32d354-xxxx-xxxx-xxxx-xxxx |
|
| GitHub PAT for the service connection | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
|
| Self-hosted Linux agent pool name | Default |
|
| GitHub user ID | MyHandle |