SOLVE the PROBLEMS everyone has migrating to GitHub from Azure DevOps Repos | Migrate to GitHub
HTML-код
- Опубликовано: 1 окт 2024
- Migrate your Git repository from Azure DevOps Repos to GitHub should be easy. But it is not always like that. We need to take care of Authentication, Clone, Branches, Tags, History... and much more.
How to solve the problems everyone has migrating to GitHub from Azure DevOps Repos?
In this video, part of the "Migrate to GitHub series" we will tackle all this git migration problems and we will successfully migrate Azure repos to GitHub (including full history, branches and tags)!
🆘 NEED HELP? 🆘
Book a 1:1 Consultation with CoderDave: geni.us/cdconsult
We can talk about GitHub, Azure DevOps, or any other DevOps tool or project you need help with!
🙏🏻SUPPORT THE CHANNEL🙏🏻
Buy me a coffee: www.buymeacoff...
PayPal me donation: paypal.me/dabe...
💬JOIN THE COMMUNITY
► Website: coderdave.io
► Discord: geni.us/cddiscord
► Newsletter: coderdave.io/n...
► Blog: dev.to/n3wt0n
► GitHub: github.com/n3wt0n
► Twitter: / davidebenvegnu
► Facebook: / coderdaveyt
🎥VIDEOS
► Use GitHub Like a PRO: • Use GitHub like a PRO!...
► Why GitHub: • 10 Reason Why EVERYONE...
► GitHub Dark Mode: • The official GitHub Da...
📄RESOURCES
► Azure DevOps To GitHub Repo Migrator: github.com/n3w...
🎤PODCAST: geni.us/cdpodcast
❓QUESTIONS?
Have a question about DevOps, Cloud, Coding, or Anything Else? Post in comments section of this video!
🔴SUBSCRIBE to CoderDave here: www.youtube.co...
_______________
👕GET MY MERCH: geni.us/cdmerch
🔮TOOLS I USE
► Twingate - Connect to your Private Resources SECURELY: geni.us/twingate
► TubeBuddy - #1 RUclips channel Management tool (FREE): www.tubebuddy....
► Moosend - Free Newsletter and Automation Platform: geni.us/moosend
📸🖥️GEAR AND SOFTWARE
► Music - Epidemic Sound (Get 30 days free): epidemicsound....
► Editing - Adobe Premiere Pro: geni.us/AdobeV...
► Gear I Use for RUclips: kit.co/CoderDa...
► Gear I Use for Streaming: kit.co/CoderDa...
► My Computer Setup: kit.co/CoderDa...
► Full office setup: github.com/n3w...
Disclaimer:
Some product links are affiliate links which means if you buy something I'll receive a small commission at no additional cost to you.
As an Amazon Associate, I earn from qualifying purchases.
Question of the Day ✔: Will you migrate from Azure DevOps Repos to GitHub?
absolutely! thxs a lot for the video!
Hi @CoderDave, will this migration migrate the work items to issues too?
Unfortunately no, only the code
Hi @CoderDave,
Is there a way to configure the migration script to add permissions for users in GitHub for the repos migrated to GitHub from ADO?
is this still valid ?
Yes it is. I have another video which explains how to migrate a single repo, but with limitations and manually. But for multiple repos, or for more options, this is still good :)
Thanks for the description. That was helpful. Can you please help if I want to move GIT repositories from Azure Devops Server(On Prem) to GitHub. Do I need to make changes?
Also, Can I do migrate multiple GIT repositories at a single click?
Happy to know it helped you 😊 migrating from AzDO Server is the same, because it has the same settings and also the PAT. So that’s works the same.
AFAIK the only way to migrate multiple repos is to create a script that iterates over your repos and invoke the migration script for each one of those. But I’d recommend doing it one by one so you have control of what happens 😄
CoderDave Yes. I’ll try than on in OnPrem. Also, do we get the whole history, commits, branches , pull requests ..with this?
Yep, if you use the commands like I detailed in the video (and in my script on GitHub) you get everything, including the history 😎
@@CoderDave Thanks. I was able to migrate code from Azure DevOps to GitHub and got the whole history. Dont see the pull requests though. I tried using API's for them.
Though it got succeeded, I got this error in the logs, when I ran migrate.ps1
PS C:\Users\Vinay\Documents\GitHubProjects\ImportRepofrom_ADO-GHE\Scripts\ADS to GHE Repo Migration> .\migrate.ps1
cmdlet migrate.ps1 at command pipeline position 1
Supply values for the following parameters:
AzDOPAT: e2znhsbkoq6aeg6ouaq
AzDOOrg: vinay
AzDOPrj: vsdotnetdevops
AzDORepo: dotnetcorevinayc07fc9ea4748
GHUser: vinay
GHRepo: MigrationRepo
Set-Location : Cannot find path 'C:\Users\Vinay\Documents\GitHubProjects\ImportRepofrom_ADO-GHE\Scripts\ADS to GHE
Repo Migration\migration' because it does not exist.
At C:\Users\Vinay\Documents\GitHubProjects\ImportRepofrom_ADO-GHE\Scripts\ADS to GHE Repo Migration\migrate.ps1:31
char:1
+ Set-Location migration
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\Users\Vina...ation\migration:String) [Set-Location], ItemNotFoundExc
eption
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.SetLocationCommand
Hi, it could be or that the script has a problem with long paths or with path containing spaces. I will debug it as soon as I have time
Hi, Can you please share the details of how to import multiple(bunch of) Azure repositories to GitHub?
You can save the URL of the repo, new repo name in GitHub, Organization, etc, in a CSV file
Something like
Org,Project,AzDoRepo,GHRepo,
MyOrg1,Project1,reponame1,repoingh1
MyOrg2,ProjectABC,reponame2,repoingh2
then use this commands in another script (in the same folder as the main script):
$repos = Import-Csv -Path .
epos.csv -Delimiter ',' -Header Org, Project, AzDoRepo, GHRepo
foreach ($repo in $repos)
{
try { Get-ADUser $item.TermId -Properties * }
catch { $badItems.Add($item) | Out-Null }
& './migrate.ps1 -AzDOPAT -AzDOOrg $item.Org -AzDOPrj $item.Project -AzDORepo $item.AzDoRepo -GHPAT -GHUser -GHRepo $item.GHRepo'
}
I don't see the import option in my GitHub account what is the problem, How can we get that import option. Can we do that using commands for git lfs
The repo should be "non-initialized" to be able to see the import option. Which means, when you create it don't add readme, license, or anything else
How to download source code from azure devops using powershell script?can you help me out i tried some script..
Hi. You can check out the script I made: github.com/n3wt0n/AzureDevOpsToGitHubRepoMigrator/blob/master/Scripts/migrate.ps1
I think PR's are not properly imported :o
are not being *
why not use SSH key? so you can use the same key on both Azure DevOps and GitHub
I’m not a fan of reusing the same ssh key in multiple services. That said, when I was going through the documentation while developing the migration scripts I’ve seen that there was a specific operation that was not supported over SSH but only over HTTPS. I don’t currently remember which one tho, I’d have to find it out again
Thanks Davide - this would be really useful in an extension
Thanks. Azure DevOps extensions have limits. But I have all the scripts, and even containerized versions of them for ACI in the GitHub repo linked in the video description. Once you get the cointainer, you can do anything you want ;)
I'm trying to follow same steps but it gives error for 100MB limit exceeds, when I checked for large file, I found in object->pack there is pack file which having 195MB of size. Is there any way to clone such repo on github
Hi. GitHub allows a max single file size of 100mb. You could try using Git LFS (git-lfs.github.com/) but there are limits there as well (docs.github.com/en/github/managing-large-files/versioning-large-files/about-git-large-file-storage)
In general, however, big files like that shouldn't be committed into git. You should be vigilant to not version binary or other similar blob type files. The reason for this is that Git doesn't handle binaries well, and storage can be a big penalty. So if you find yourself pushing 100MB per file, you should check what type of file you are dealing with and use other services as appropriate, for example GitHub Packages
@@CoderDave yes, actually the larger file is pack file which is located inside .git directory. So I can't do anything with this file
@@CoderDave I tried Git LFS but no luck
You can try using the “git repack” command
Would the -mirror contains branch policies as well? If not how to migrate the policies to GitHub.
Hey, no branch policies are a tool-specific thing so they are not in the git metadata. Since they are tool-specific, they are different for each of the platforms… hence, afaik there is no way to migrate them between platforms, the only way is to do it manually.