简体   繁体   English

无法将 TFVC 从其他项目集合迁移到 GIT

[英]Unable to migrate TFVC to GIT from other collection of project

In Azure DevOps Server 2019 (on premise), we have one collection of project with one BIG project.在 Azure DevOps Server 2019(内部部署)中,我们有一个项目集合和一个 BIG 项目。 But perfomance are really bad.但是性能真的很差。

We want to split this BIG project in many little project :我们想把这个大项目拆分成许多小项目:

  • One collection of project by team团队项目合集
  • One project by product一品一品

I have a duplicated environnement to test.我有一个重复的环境要测试。 In the same organisation, I have created a collection of project 'Product1' with Git.在同一个组织中,我使用 Git 创建了一个项目“Product1”的集合。 In Azure DevOps with the tool Import from TFVC , I select TFVC, enter in Path $/BigProject/Team1/Product1/Main and uncheck Migrate with history.在使用工具Import from TFVC Azure DevOps 中,我选择 TFVC,输入路径$/BigProject/Team1/Product1/Main并取消选中 Migrate with history。 I am getting this error :我收到此错误:

There is no item in the given path which can be imported

VSTS redirects me to https://go.microsoft.com/fwlink/?linkid=839462 but there is no description of this error, it's a general import guide. VSTS 将我重定向到https://go.microsoft.com/fwlink/?linkid=839462,但没有对此错误的描述,它是一般导入指南。

I think I need precise the collection in the path.我想我需要精确的路径中的集合。 Then I try :然后我尝试:

Collection/BigProject/Team1/Product1/Main
$Collection/BigProject/Team1/Product1/Main
/Collection/BigProject/Team1/Product1/Main

But I have the same error.但我有同样的错误。

I know we can manually migrate like Unable to perform TFVC to GIT import on VSTS and I will do this for my team.我知道我们可以像Unable to perform TFVC to GIT import on VSTS一样手动迁移,我会为我的团队这样做。 But for the other teams, it would be better to have a simple tool.但是对于其他团队来说,最好有一个简单的工具。

How can I import in Git project, a TFVC project in other collection with the tool Import from TFVC ?如何使用Import from TFVC的工具在 Git 项目中导入其他集合中的 TFVC 项目?

While it's true that you can only import from within the same collection, it is very easy to migrate a whole git repo from one collection to another.虽然您只能从同一个集合中导入,但将整个 git 存储库从一个集合迁移到另一个集合非常容易。

So the trick here is:所以这里的诀窍是:

  • Use the Import feature to import the data from TFVC to a git repo in the source project.使用导入功能将数据从 TFVC 导入到源项目中的 git repo。

    在此处输入图片说明

  • Take the clone URL from the source project从源项目中获取克隆 URL 在此处输入图片说明

    在此处输入图片说明

  • Go to the target project and choose to import a git repository into that project and point it to the repo in the source project.转到目标项目并选择将 git 存储库导入该项目并将其指向源项目中的存储库。 I used a Personal Access Token to auth, but you may need to generate and use another kind of alternate creds.我使用个人访问令牌进行身份验证,但您可能需要生成和使用另一种替代凭证。

    在此处输入图片说明

This will work just fine.这将工作得很好。 The git repo will be cloned with all details and history. git repo 将与所有详细信息和历史记录一起克隆。 The portability of Git makes this a seamless process.It works from one TFS Server to another, but also from any other Git Provider or Azure DevOps Services. Git 的可移植性使其成为一个无缝过程。它可以从一个 TFS 服务器运行到另一个,也可以从任何其他 Git 提供程序或 Azure DevOps 服务运行。

Notice注意

While splitting your collection into multiple collections will make your TFS instance more manageable, it will create some limitations should you want to migrate to Azure DevOps in the cloud later.虽然将您的集合拆分为多个集合将使您的 TFS 实例更易于管理,但如果您想稍后迁移到云中的 Azure DevOps,则会产生一些限制。 Each collection will turn into a separate account upon import.每个集合在导入时将变成一个单独的帐户。 So if you want a single account in the future, the recommendation is to stay in a single Project Collection.所以如果你以后想要一个单一的账户,建议是留在一个单一的项目集合中。 Azure DevOps Service doesn't have the concept of a collection. Azure DevOps 服务没有集合的概念。

A single Team Project can hold more than 1 Git Repositories, so it's easy to house multiple code repositories under a single Project, then multiple projects in a single collection.一个团队项目可以容纳 1 个以上的 Git 存储库,因此可以轻松地在单个项目下容纳多个代码存储库,然后在单个集合中容纳多个项目。

You can only migrate code from an existing TFVC repository to a new Git repository within the same organization/collection.您只能将代码从现有 TFVC 存储库迁移到同一组织/集合内的新 Git 存储库。

If you want to use TFVC import tool, you could consider spliting a single project collection into multiple project collections.如果要使用TFVC导入工具,可以考虑将单个项目集合拆分为多个项目集合。 For example, you could split a collection only contains BigProject , then migrate to Git in the same collection.例如,您可以拆分一个只包含BigProject的集合,然后迁移到同一集合中的 Git。

https://docs.microsoft.com/en-us/azure/devops/server/admin/split-team-project-collection?view=azure-devops https://docs.microsoft.com/en-us/azure/devops/server/admin/split-team-project-collection?view=azure-devops

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM