Skip to content

Latest commit

 

History

History
77 lines (44 loc) · 3.19 KB

File metadata and controls

77 lines (44 loc) · 3.19 KB

SCRIPTS - Azure DevOps To GitHub Repository Migrator

The scripts to perform the migration.

Usage

There are 3 migration scripts:

  • migrateVerbose.ps1 - Interactive and Verbose
  • migrate.ps1 - Non Interactive
  • migrate-mirror.ps1 - Non Interactive, Mirror

Interactive & Verbose

The interactive verbose version of the migration, migrateVerbose.ps1, is ideal for manual migrations.

It is interactive, it asks for the input in a nicer way, and it prints out the status of the migration.

NOTE: you need both scripts, because migrateVerbose.ps1 uses migrate.ps1 to perform the actual migrations

Non-interactive

The non-interactive migration script, migrate.ps1, is instead ideal for automated scripted migrations

To invoke it, use the following syntax:

./migrate.ps1 -AzDOPAT <AZURE_DEVOPS_PAT> -AzDOOrg <AZURE_DEVOPS_ORGANIZATION> -AzDOPrj <AZURE_DEVOPS_PROJECT_NAME> -AzDORepo <AZURE_DEVOPS_REPOSITORY_NAME> -GHPAT <GITHUB_PAT> -GHUser <GITHUB_USERNAME> -GHRepo <GITHUB_REPOSITORY_NAME>

NOTE: you need only the migrate.ps1 script

Mirror

This script uses the --mirror flag for both the CLONE and the PULL operations.

To invoke it, use the following syntax:

./migrate-mirror.ps1 -AzDOPAT <AZURE_DEVOPS_PAT> -AzDOOrg <AZURE_DEVOPS_ORGANIZATION> -AzDOPrj <AZURE_DEVOPS_PROJECT_NAME> -AzDORepo <AZURE_DEVOPS_REPOSITORY_NAME> -GHPAT <GITHUB_PAT> -GHUser <GITHUB_USERNAME> -GHRepo <GITHUB_REPOSITORY_NAME>

WARNING: This script leaves the repository on the local folder in a non usable state, meaning that it won't be possible to use it as a normal repository aka wokring copy

Prerequisites

Both the scripts and the containerized version require a series of prerequisites to work.

Azure DevOps

You need to know/have:

  • The name of the Azure DevOps Organization where your source repository resides (the XXX in dev.azure.com/XXX or XXX.visualstudio.com)
  • The name of the Azure DevOps Team Project_ where the source repository resides
  • The name of the Azure DevOps Source Repository to migrate (because a single Team Project may contain multiple repositories)

You also need to generate a PAT (Personal Access Token) in Azure DevOps with the following permissions:

  • Code
    • Read

For instruction on how to generate a PAT in Azure DevOps, take a look at the official documentation here

GitHub

You need to know/have:

  • The GitHub Username or (Organization) with which you have created the destination repository
  • The name of the GitHub Destination Repository

Please note that the Destination Repo must be empty and not be initialized.

You also need to generate a PAT (Personal Access Token) in GitHub with the following permissions:

  • repo (Full control)

For instruction on how to generate a PAT in GitHub, take a look at the official documentation here