遠程 TFS 2015 到 Azure Devops(私有云)遷移 (Remote TFS 2015 to Azure Devops (private cloud) Migration)


問題描述

遠程 TFS 2015 到 Azure Devops(私有云)遷移 (Remote TFS 2015 to Azure Devops (private cloud) Migration)

我當前的組織需要將源代碼 + 歷史鏈接從位於遠程站點的供應商 TFS 2015 遷移到我們的 Azure Devops(Repos)。我面臨的挑戰是,由於源 TFS 在遠程站點中並且沒有通過我們的 AD 連接,因此找不到鏈接它的方法。目前我們正在使用顯式登錄到他們的 tfs 並獲取代碼。是否有任何可能的方法來遷移相同的內容並每天進行同步,持續幾個月並拔下對遠程的依賴。

任何幫助將不勝感激..


參考解法

方法 1:

Not sure the Azure DevOps(Repos) you mentioned are Azure DevOps Service (prior VSTS) or Azure DevOps Server 2019(prior TFS) In your case, seems you just want to perform a source code synchronization between TFS2015 to Azure DevOps service or Azure DevOps server.

For Azure DevOps Service : When you decide to make the move from Azure DevOps Server to Azure DevOps Services, there are many approaches to doing this which vary in both the fidelity of the data transfer and the complexity of the process.

  • Option 1: Copy the most important assets manually
  • Option 2: High fidelity database migration
  • Option 3: Using public API‑based tools for higher fidelity migration

Only the option2 will include source control history during the migration. But it also have some limitation, such as import tool supported version. Currently only the following versions of Azure DevOps Server are supported for import: Azure DevOps Server 2019 and Azure DevOps Server 2019.0.1

In your scenario, you could use a CI build in TFS2015 to sync the Azure DevOps repo automatically. And the biggest challenge here is the authentication for both TFS and Azure DevOps Service. Just as you mentioned using explicit logins and powershell script should do the work.

A sample for your reference:

1. Create a CI build in TFS 2015

In your TFS 2015 project where the git repo hosted ‑> create a build definition with the TFS 2015 git repo as repository ‑> enable CI with all branches included.

enter image description here

2. Add a PowerShell task to sync TFS2015 git repo to Azure DevOps Service Add a PowerShell task in the build definition with below script:

if ( $(git remote) ‑contains 'vsts' )
{
    git remote rm vsts 2>&1|Write‑Host
    echo 'VSTS Account removed'
}


git remote add vsts https://Personal%20Access%20Token:{PAT}@{account}.visualstudio.com/{project}/_git/{repo}

git checkout ${env:BUILD_SOURCEBRANCHNAME} 2>&1|Write‑Host
git reset ‑‑hard origin/master 2>&1|Write‑Host
echo 'update local branch with remote successfully'
git push  vsts ${env:BUILD_SOURCEBRANCHNAME} ‑f 2>&1|Write‑Host

Note: the vsts remote should be added with credential. And it uses PAT for authentication in the Azure DevOps Service git repo URL. And you just need to replace the real PAT, accountname, projectname and reponame in the URL https://Personal%20Access%20Token:{PAT}@marinaliu.visualstudio.com/{project}/_git/{repo}.

Save the build definition, and now when any branches are updated in TFS 2015 git repo, VSTS git repo will be synced automatically for the corresponding branches.

(by RenjiPatrickLu‑MSFT)

參考文件

  1. Remote TFS 2015 to Azure Devops (private cloud) Migration (CC BY‑SA 2.5/3.0/4.0)

#azure-devops #tfs #migration #azure-repos #cloud






相關問題

Visual Studio Online Build - Visual Studio SDK 和 Modellng SDK (Visual Studio Online Build - Visual Studio SDK and Modellng SDK)

有沒有辦法將現有的“功能”分配給史詩? (Is there a way to assign existing "feature" to epic?)

在路徑 Visual Studio Team Services 中找不到 curl (curl was not found in the path Visual Studio Team Services)

遠程 TFS 2015 到 Azure Devops(私有云)遷移 (Remote TFS 2015 to Azure Devops (private cloud) Migration)

無法再推送到 myProject.visualstudio.com (Can't push to myProject.visualstudio.com anymore)

使用 Visual Studio Code 連接 AzureDevOps Git 存儲庫時出現問題 (Issue in connecting AzureDevOps Git repo using Visual Studio Code)

適用於 Azure DevOps 和本地 PC 的發布生成事件 (Post Build event that works on both Azure DevOps and Local PC)

使用 Azure Devops 進行 CI/CD 部署 (CI/CD Deployment Using Azure Devops)

取回我創建的 DevOps 組織的所有權 (Get back ownership of DevOps organization that was created by me)

在使用源代碼管理時,我如何才能對源代碼的不同部分的用戶組擁有不同的權限? (While using source control, how can I have different permissions for groups of users for different parts of the source code?)

在 Azure DevOps 中自動更改用戶的訪問級別 (Automatically change access level on a user in Azure DevOps)

Azure DevOps Powershell 獲取與構建管道相關的工作項 (Azure DevOps Powershell get work item related to build pipeline)







留言討論