{"id":14063947,"url":"https://github.com/kunduso/MigrateToAzureRepos","last_synced_at":"2025-07-29T17:31:02.608Z","repository":{"id":48820463,"uuid":"278604478","full_name":"kunduso/MigrateToAzureRepos","owner":"kunduso","description":"a powershell script to bulk migrate repositories from bitbucket to Azure Repos","archived":false,"fork":false,"pushed_at":"2022-11-01T03:32:31.000Z","size":20,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-04T02:35:19.466Z","etag":null,"topics":["azure-devops","bitbucket","git","powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kunduso.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-10T10:20:32.000Z","updated_at":"2023-12-05T16:39:18.000Z","dependencies_parsed_at":"2023-01-20T18:01:58.367Z","dependency_job_id":null,"html_url":"https://github.com/kunduso/MigrateToAzureRepos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kunduso/MigrateToAzureRepos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunduso%2FMigrateToAzureRepos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunduso%2FMigrateToAzureRepos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunduso%2FMigrateToAzureRepos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunduso%2FMigrateToAzureRepos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kunduso","download_url":"https://codeload.github.com/kunduso/MigrateToAzureRepos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kunduso%2FMigrateToAzureRepos/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267726742,"owners_count":24134901,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-29T02:00:12.549Z","response_time":2574,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-devops","bitbucket","git","powershell"],"created_at":"2024-08-13T07:03:35.453Z","updated_at":"2025-07-29T17:31:02.312Z","avatar_url":"https://github.com/kunduso.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"[Open in Visual Studio Code](https://open.vscode.dev/kunduso/MigrateToAzureRepos)\n![Image](https://skdevops.files.wordpress.com/2020/07/21.-migratingfrombbtoar-image0-1.png)\n## Motivation\n\nI had a task at hand to migrate all repositories from a particular team in bitbucket to Azure Repos. I knew about the UI based tool that is available to import repositories from AzureDevops but there is a limitation there. Only one repository could be moved at a time. And each time (manually) information has to be provided. If you are interested in knowing more about it please visit my article on that [here](http://skundunotes.com/2020/07/10/migrating-a-repository-from-bitbucket-to-azure-repos-ui-based/).\n\nI had to move more than three dozen bitbuket repositories and that approach did not sound exciting and hence I automated the task. Here is a link to my [note](http://skundunotes.com/2020/07/10/migrating-a-repository-from-bitbucket-to-azure-repos-using-powershell/)\n\n## Prerequisites\n### **Installations**\nInstall Azure CLI from [here](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)\n\u003cbr /\u003eInstall [Atlassian.Bitbucket Powershell module](https://www.powershellgallery.com/packages/Atlassian.Bitbucket/0.14.0) from Powershell Administrator console.\n### **Input Parameters**\nBitBucketUserName : your bitbucket user name\n\u003cbr /\u003eBitBucketEmailAlias : email id associated with bitbucket\n\u003cbr /\u003eBitBucketPassword : bitbucket password\n\u003cbr /\u003eRootFolderForProjects : local folder path for migration work. Folder does not need to exist. Folder will be deleted after the script runs successfully.\n\u003cbr /\u003eAzureDevopsPAT : AzureDevops team project PAT\n\u003cbr /\u003e$AzureDevopsOrgURL : similar to https://dev.azure.com/MyOrganizationName/\n\u003cbr /\u003eAzureDevopsTeamName : project team name in AzureDevops\n\n## Usage\n-Open windows powershell as admin before you run the script\n\u003cbr /\u003e-Copy/download powershell file and execute below command\n\n\u003cpre\u003e\u003ccode\u003e.\\MigrateToAzureRepos.ps1 -BitBucketUserName \"$(YourBitBucketUserName)\" -BitBucketEmailAlias \"$(YourBitBucketEmailID)\" -BitBucketPassword \"$(YourBitBucketPassword)\" -RootFolderForProjects \"$(LocalMachineFolderPath)\" -AzureDevopsPAT \"$(AzureDevopsPAT)\" -AzureDevopsOrgURL \"$(AzureDevopsOrgURL)\" -AzureDevopsTeamName \"$(YourAzureDevopsTeamName)\"\u003c/code\u003e\u003c/pre\u003e\n\n## Algorithm\nCreate local folder for clone work\n\u003cbr /\u003eLogin to Bitbucket\n\u003cbr /\u003eGet a list of bitbucket teams\n\u003cbr /\u003eFor each bitbucket team, get a list of projects associated with that team\n\u003cbr /\u003e    -For each projects, get a list of repositories associated with that project\n\u003cbr /\u003e        -For each repository,\n\u003cbr /\u003e            -clone the repo to local\n\u003cbr /\u003e            -check if a repository exists in Azure Repos, if not create one\n\u003cbr /\u003e            -push code from local to repo in Azure Repos\n\u003cbr /\u003e        continue until all repositories in particular project are migrated\n\u003cbr /\u003e    continue until all projects in particular bitbucket team are migrated\n\u003cbr /\u003econtinue until all teams in particular bitbucket login are migrated\n\u003cbr /\u003eLogout of bitbucket\n\u003cbr /\u003eDelete local folder\n\u003cbr /\u003eDelete AzureDevps PAT from environment\n## Error\nIf you get an error like the one below, most probably the powershell module `Atlassian.Bitbucket` was not installed. Install that following the steps mentioned above.\n```diff\n-import-module : The specified module 'Atlassian.Bitbucket' was not loaded because no valid module file was found in any module directory.\n-At C:\\ed\\MigrateToAzureRepos\\MigrateToAzureRepos.ps1:14 char:1\n-+ import-module Atlassian.Bitbucket\n-+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n-    + CategoryInfo          : ResourceUnavailable: (Atlassian.Bitbucket:String) [Import-Module], FileNotFoundException\n-    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand\n```\nIf you get this error even after installing the module, open a new Administrator Powershell and execute the powershell file `MigrateToAzureRepos.ps1` with appropriate parameters.\n\u003cbr /\u003e Apart from that if there are any issues with executing the powershell file, please let me know.\n\n## Contribution/Feedback\nPlease submit a pull request with as much details as possible\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunduso%2FMigrateToAzureRepos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkunduso%2FMigrateToAzureRepos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkunduso%2FMigrateToAzureRepos/lists"}