Migrating source code from TFS to VSTS - tfs

I am trying to migrate Source code from TFS to VSTS. I tried git-tf command to migrate and was able to migrate successfully but i am not able to migrate the history. Can someone guide me on what i am doing wrong. Please note i am not migrating to GITVC but migrating to TFVC in Visual studio from On premise TFS server.
Steps are ...
git-tf clone http://onprimisetfsurl/ $/project project
git-tf clone http://Visualstudiotfvcurl/ $project project1
git pull project1 into project
git-tf checkin --deep

Look at OpsHub https://visualstudiogallery.msdn.microsoft.com/28a90a17-d00c-4660-b7ae-42d58315ccf2 since that is the one that was recommended by the VSTS manager https://blogs.msdn.microsoft.com/bharry/2014/05/14/migrating-on-premises-tfs-to-vs-online/
https://www.visualstudio.com/en-us/articles/adopting-vsts also covers other tools if that doesn't work for you.

Add "--deep" when you perform git-tf clone:
git-tf clone http://onprimisetfsurl/ $/project --deep
Add my steps for your reference:
git-tf clone http://tfsurl $/tfsproject --deep
Create a project "vstsproject" in VSTS.
Delete the "BuildProcessTemplates" folder in the vstsproject from web portal.
Create a new folder for vstsproject on local machine.
Run "git init" to set this folder to a git repository.
Pull the changes in tfsproject into the new created repo.
Run "git log" to make sure the history is correct.
git-tf configure https://vstsurl $/vstsproject --deep
git-tf checkin --deep

Related

Clone GIT to TFS (AzureDevOps) with git-tfs

we have an local DevOps Server 2019 with our old projects and I am able to clone this projects with git-tfs to local Git repositories. Everything is fine. After that I can push this repositories to our AzureDevOps Git repositories. Everything ok.
Now we have some projects and colleagues who want to use TFVC for these special projects. So my idea was to clone these projects from local TFS to Git and then use git-tfs rcheckin to push it to our AzureDevOps project.
But when I use "git-fts rcheckin --remote azuretfs" I get "error: latest TFS commit should be parent of commits being checked in"
When I use "git-tfs checin --remote azuretfs" all files are uploaded to the AzureDevOps project but without the history.
So can anyone describe what I have to do?
Note: I don't want to use the MigrationTool offered by Microsoft because of to many erros during validation the templates of work items etc. (we dont use it...)
For those who are looking for the same:
With the 'old' git tf tool (https://archive.codeplex.com/?p=gittf) you can migrate old TFVC project to Azure DevOps(TVFC).
If you want to migrate old TFVC projects to AzureDevOps(GIT) you should use git tfs (http://git-tfs.com/)
What you could try without guarantee of success...
Note: As I said, you will be able to migrate the history from one branch only.
Create the folder/project in TFVC where you want to put the source code.
Migrate this folder with git tfs clone (to have a git commit with the git-tfs metadata required to rcheckin)
Add the already migrated history repo (let's call it RepoWithHistory) as a local remote in this new repository (let's call it NewRepo). And git fetch
Clean metadata for only the commit coming from RepoWithHistory with something looking like: git filter-branch -f --msg-filter "sed 's/^git-tfs-id:.*$//g'" -- --all. But be careful to keep the metadata on the commits coming from NewRepo.
Use git replace --graft <sha1_of_first_commit_of_RepoWithHistory> <sha1_of_last_commit_of_NewRepo> to graft the 2 histories (the history must be on top of the one from the new one)
Use git rcheckin --no-merge to migrate the history to TFVC (that will be long...)
I hope it will help.
PS: perhaps you should try to do it on a small subset of commits to be able to verify it will works before doing it in the real TFVC project.

git-tf clone to DevOps

I'm trying to use git-tf to migrate some old TFVC projects from our local TFS to AzureDevOps (also a project with TFVC).
git-tf clone ... works
No I have the folder e.g. C:\TFSMigration\ProjectX
When I do git-tf checkin --deep the sourcecode is checked in in DevOps correctly but all files are in the parent-repository not in $DevOpsProjectWithTFVC/ProjectX
Here is my config:
collection = https://myCompany.visualstudio.com
serverpath = $/DevOpsProjectWithTFVC
For this to work, you need a clean git clone of you original TFVC. Do the following:
git-tf clone <TFVC> <Branch> --deep from the original TFVC to a local git repo.
git clone <Local git repo> the local repo to a new folder in your local computer.
git-tf configure <Destine TFVC> --deep (Execute this inside the new folder cloned from the git repo)
git-tf checkin
The first clone you execute using git-tf is mapped to the original TFVC so you won't be able to push the changes from there.

Migrate TFS to TFS including changesets

I need to download entire project from TFS including changesets and need to add to another TFS server with all changeset details.
Is this possible in TFS?
Please help.
I made this done using git-tf and Powershell
I installed git-tf using the following link
https://chriskirby.net/blog/migrate-an-existing-project-from-tfs-to-github-with-changeset-history-intact
I cloned my existing TFS repo to Git,by using
git-tf clone https://myaccount.visualstudio.com/DefaultCollection
$/MyBigProject/MyMainBranch --deep
Inside the GIt folder there is a subfolder named .git,inside we can find a file git-tf.
Inside the file rename changeset to TFS.
To checkin GIT to TFS, configure the TFS folder where you need to copy the GIT. Folder must be empty.
change directorty to the GIT folder in powershell.
git-tf configure http://xxxxxxx:8080/tfs/DefaultCollection/
$/xxxxx/xxxx --force
git-tf checkin --deep --autosquash
Note:
Commit time will be the current time and for all changesets and author will be the person doing the operation.
To keep the author you can try
git-tf checkin --deep --autosquash --keep-author

How to clone a VSTS project/workspace locally?

We have a project/workspace setup in Visual Studio Team Services online. I would like to get a local backup of the workspace and project with all of its artifacts (attachments, Wiki notes and attachments, etc.).
Would a local version of TFS pointed to VSTS online clone the epics, features and stories locally? This is what I really need.
What is the process to accomplish this?
You can not clone the whole contents of a team project, but clone the source code from version control system (Git or TFVC) is possible.
If you are using Git as VCS, you can use below command to clone the VSTS git repo:
git clone <repo URL>
And you can also refer the document to clone a VSTS git repo via VS.
If you are using TFVC as VCS, you can map TFVC repo locally in VS. Detail steps you can refer Develop and share your code in TFVC using Visual Studio.
Seems you also want to migrate WIT from TFS to VSTS. You can refer these related posts: Migrate Workitems from local TFS into VSTS and Migrating Work Items from TFS 2017 to VSTS.
Besides, you can also refer the document Migrate data from TFS to VSTS.

xcode 4.6 to commit source code to the TFS

I got a problem while using xcode 4.6 to commit source code to the TFS, i'm using git-tf
but i can't commit source to server. I have been cloned folder from server. Please help me.
Once you have cloned your code on TFS to local git repo you are ready to make changes. Once you do them use:
git commit -a -m "commnent"
Now you can check them in your TFS:
git tf checkin
All commits will be checked as one single changeset on TFS.

Resources