AZ-401: Repository Migration from Azure DevOps to GitHub
Migrate one Azure DevOps Cloud repository by first fixing its source, destination, access and recovery records, then reviewing the supported importer script so it runs only the selected operation. Trial that operation, choose destination visibility explicitly, and accept the result only after checking completed migration state, the repository log, retained history and metadata, and effective destination access. A queued request or a newly visible repository is insufficient evidence.
This procedure uses GitHub Enterprise Importer and its ADO2GH extension for GitHub's command-line interface (CLI). The worked route targets an existing GitHub Enterprise Cloud organization on GitHub.com from Azure DevOps Cloud; Azure DevOps Server is outside this route. It is an authorized, nonproduction example, not a report of a migration, token creation or command execution performed for this article.
Record the selected repository and recovery decision
Complete AZ-401: Project Repository and Team Access Boundaries first. Identify the actual source organization, team project and repository, the destination enterprise and organization, the intended destination repository name, and the people authorized to perform and accept the migration.
For a concrete example, suppose the owner selects the billing repository from the Delivery project and an approved sandbox destination. Those names describe an illustrative exercise. Replace them with verified identifiers; do not let a familiar display name substitute for the actual repository.
Before configuring the importer, keep a recommended migration record:
| Record | Evidence to retain | Acceptance use |
|---|---|---|
| Selected source | Repository identity, recorded branches/tags and full commit identifiers, relevant history and representative pull-request records | Establish what was selected before the move |
| Recovery material | Owner-verified source/recovery copies, their location and a usable recovery plan | Preserve an option if validation or cutover fails |
| Destination | Organization, repository name, approved visibility and access specification | Detect an incorrect target or exposure |
| Timing | Source-write window, last accepted source state and responsibility for later changes | Prevent concurrent work from disappearing from the handoff |
| Separate assets | Boards, Pipelines, credentials, integrations and their owners | Avoid declaring an entire delivery system migrated from a repository result |
Preserve the original source and recovery material until the owner accepts the destination and the agreed retention decision is satisfied. This is an operational safeguard, not a claim that the importer creates a complete backup or can reverse every change. Detailed recovery methods remain a separate task.
Match the comparison to the importer's actual scope
The documented route includes Git source and commit history, pull requests, their user history, work-item links and attachments, and repository branch policies with stated exclusions. User-scoped and cross-repository branch policies are excluded. Importing a work-item link does not move the corresponding Boards work item or prove that its integration works.
Git Large File Storage (Git LFS) objects are not migrated by the importer, even when the repository uses Git LFS. Record an owner and separate follow-up for those objects. Check the current documented size and reference limits against the selected repository before scheduling it; do not infer eligibility merely because ordinary Git hosting worked.
Treat these as comparison boundaries. A missing excluded item needs an explicit disposition, while a missing supported item needs investigation. Neither should silently disappear from a generic migration-success statement. Repository permissions also need separate reconciliation; the preparation guide does not promise to copy Azure DevOps grants into GitHub.
Establish source and destination authority
A GitHub organization owner can perform the migration; another operator needs the delegated migrator role first. The destination credential must be a personal access token (PAT) of the classic type. Fine-grained tokens are unsupported for this route, and an organization policy blocking classic tokens prevents using it. Return that policy conflict to its owner rather than weakening the policy as an automatic setup step.
| Task and role | Documented destination classic PAT scopes |
|---|---|
| Run the repository migration or download its log as an organization owner | repo, workflow and organization-administration scope; see the exact scope mapping in Manage access under Authoritative Sources |
| Perform those tasks as a delegated migrator | repo, workflow and organization-read scope; see the exact scope mapping in Manage access under Authoritative Sources |
The source Azure DevOps PAT needs work-item, code and identity read scopes. Set GH_PAT for the destination and ADO_PAT for the source through approved secret handling in the designated process. Keep tokens out of scripts, migration records and shared transcripts. The broader inventory-report and multi-organization examples require their own authorized scope.
Resolve applicable network allow lists, identity-provider restrictions and repository rulesets with their owners before running the migration. Record any approved temporary change and its restoration. An unresolved restriction is a stop condition, not authority to disable organization-wide controls.
Configure the supported importer
Use an approved local environment with PowerShell for the generated script. The installation guide requires GitHub CLI 2.4.0 or later. Check the actual version, install the extension when absent, or upgrade an existing installation under the approved tool-change process, then inspect its help:
gh --version
gh extension install github/gh-ado2gh
gh extension upgrade github/gh-ado2gh
gh ado2gh --help
The install and upgrade lines address different starting states; use the applicable action. Record the installed versions and available command options. Do not replace an unsupported local setup with guessed importer flags.
The commands below assume GitHub.com. For an enterprise on GHE.com, configure its actual application programming interface (API) base input and use the documented --target-api-url option. An endpoint placeholder or another enterprise's value is not an accepted destination.
Generate and narrow the script before execution
Generate a script for the approved source organization and sandbox destination. Replace the uppercase placeholders with the actual organization names; the output is a PowerShell file:
gh ado2gh generate-script --ado-org SOURCE --github-org TRIAL_DESTINATION --output selected-trial.ps1 --download-migration-logs
Inspect the complete generated file. Retain only the chosen repository's migration and necessary completion/log handling; remove or comment out unselected repository lines. Check its source project/repository, destination organization and --target-repo value. Keep the optional --all expansion out of this exercise: pipeline rewiring, team creation and Boards configuration are separate work.
In the retained migration command, explicitly set --target-repo-visibility to the owner-approved value, such as private for this example. The script guide describes source-derived visibility, while the follow-up guide describes a private default. Do not turn either description into a universal rule. Inspect the generated argument and verify the resulting repository's actual visibility.
As a recommended review checkpoint, have the operator and owner identify every command that can change a resource and its intended target. If they cannot explain why a line belongs to the selected repository operation, stop before running it. Preserve the reviewed file and its input record so later evidence identifies the script actually used.
Trial the selected operation and then control cutover
Use an owner-approved sandbox destination with an available repository name. Run the reviewed script from its intended PowerShell working directory:
.\selected-trial.ps1
Keep the actual execution record and migration identifier. Resolve trial failures and complete the comparison and access checks below before scheduling the real move. Do not treat a completed process with unreviewed results as a successful trial.
For the real destination, generate and review its own selected-repository script rather than reusing a sandbox target by assumption. The importer does not support delta migration. Agree either a source-write freeze for cutover or an explicit plan to reconcile later changes; writes made during or after the selected migration do not automatically arrive. Record the final accepted source state and the person responsible for resuming work.
Prove completion and compare the destination
Check the actual migration state for the recorded repository. The CLI normally reports success or failure when migration completes, but --queue-only exits after queuing. A queue-only return cannot satisfy completion. Use the selected route's supported status/wait handling and the actual migration identifier; do not guess command arguments or borrow another repository's result.
At the destination repository, open Issues and inspect its Migration Log issue. Review warnings and failures as well as terminal status. Keep the log with the source/destination identifiers and observation time. If completion or the relevant log is unavailable, keep acceptance pending.
Use the following recommended comparison record against the source evidence captured before migration:
| Comparison | What to verify | How to handle a mismatch |
|---|---|---|
| Git history and references | Recorded branch/tag selections, full commit identifiers and the relevant history agree with the intended source state | Preserve both observations and investigate the selected source, timing and migration result |
| Pull-request metadata | Compare recorded discussions, attachments and work-item links within documented support | Separate supported-data omissions from explicit exclusions; retain affected identifiers |
| Policies and excluded data | Account for excluded policy scopes and Git LFS objects; inspect the resulting controls rather than assuming equivalent enforcement | Assign a supported follow-up and owner before accepting the operational state |
| Visibility | Actual destination visibility matches the approved choice | Restrict acceptance and return the exact discrepancy to the repository owner; do not apply a bulk organization command |
| Access | Intended users can perform permitted operations and the designated excluded identity cannot read protected content | Trace actual grants and identity rather than copying source roles by name |
| Source changes after selection | Reconcile the recorded later changes before switching authoritative work | Keep cutover unresolved until the owner approves their disposition |
Counts and a familiar repository name are useful observations, but neither proves that the selected history and metadata are complete. Compare the recorded identities and meaningful examples, document exclusions and unresolved items, and retain evidence that another reviewer can inspect.
Reconcile identities and delivery integrations separately
The preparation guide describes team behavior associated with ADO2GH, while generated scripts can include additional team operations. Inspect the route actually selected rather than promising that team names or repository permissions were copied. Have the authorized owner establish the required destination grants and test them using the intended identities, not only the migration operator's account.
Migrated user activity other than Git commits is attributed to placeholder identities called mannequins. Only organization owners can reclaim them. Attribution and usable repository access are separate checks; a reclaimed identity is not proof that the person has the intended permissions.
Azure Boards and Azure Pipelines can remain in use with GitHub-hosted source, but their connections require separate configuration and verification. Boards linking needs the actual project-repository connection and appropriate access; pipeline source integration and user access remain independent. A retained link or completed repository migration does not prove that a build triggers, a work item updates or a secret was transferred.
Finish with a record of completed migration state, comparison results, destination visibility/access, later-source-change decisions and remaining integration owners. Restore only the temporary network or identity-provider changes introduced for this operation through their owners. Preserve shared integrations and source/recovery copies; deleting a source repository or an entire trial organization is not routine cleanup for this bounded procedure.
Authoritative Sources
- Understand migrations from Azure DevOps to GitHub — cloud route, included repository data and exclusions.
- Manage access — operator roles, classic tokens, task scopes and restriction prerequisites. For repository migration and log download, organization owners require repo, workflow, admin:org; delegated migrators require repo, workflow, read:org.
- Install and configure GitHub Enterprise Importer — CLI/extension setup and source/destination environment inputs.
- Prepare for your migration from Azure DevOps to GitHub — inventory, structure and separate destination permissions.
- Migrate your repositories from Azure DevOps to GitHub — generated-script review, visibility, trial and no-delta conditions.
- Follow-up tasks — completion, per-repository log, visibility, mannequins and integration follow-up.
- Link GitHub changes to Azure Boards work items — separate connection and access requirements.
- Build GitHub repositories with Azure Pipelines — independent platform identities and source integration.
Related Reading
- AZ-401: Project Repository and Team Access Boundaries — prerequisite.
- AZ-401: Traceable Work from Azure Boards to GitHub Delivery — related.
- AZ-401: Recovering Selected Git Data Safely — related.

