One of clients recently requested to migrate the projects source control from TFVC (Team Foundation Version Control) to Azure DevOps. Initially, I thought it would be a lift and shift activity, but apparently, that was not the case. Had to face various issues like access related and wrong tools which led me to an incorrect path. Finally found a clean method/procedure to accomplish the given activity.
If not available, Git can be downloaded from the following: https://github.com/git-for-windows/git/releases/download/v2.29.1.windows.1/Git-2.29.1-64-bit.exe
Following steps taken for the migration:
1. Get the latest code from Team Foundation Version Control (TFVC) using any appropriate tool (in my case I have used “Git Extensions”) and update the local file system (c:\source\) which will act as the Source.
- Source example: C:\Source\
- TFVC example: http://domainname:8080/tfs/DefaultCollection/CompanyName/DepartmentName/_git/RepositoryName)
2. Open Azure DevOps and create a new repository which will act as the Destination
- Destination example: https://dev.azure.com/DepartmentName/RepositoryName/_git/RepositoryName
You may add appropriate .ignore file, sample below shows ignore files for VisualStudio)
3. Clone the Azure DevOps repository to the local file system by clicking the Clone button
Click on the “Copy clone URL to clipboard” icon to copy the URL
Now use the above-copied URL to clone the repository in the local file system,
- for example C:\Repository\
- Open the command prompt and navigate to the same location and run the following command:
- >git clone “URL of repository”
4. Copy the contents from Source (“c:\source” ref in step#1) and paste it inside “c:\Repository\MyRepositoryName\”
5. Open the command prompt and enter the following command to add the files and folder
>git add *.*
Note: Make sure to run the git add command from the appropriate repository folder name, an example shown above.
6. Commit the file changes by running the following command
>git commit -a -m “comments”
7. Check the status of the commit by running the following command
8. Push the source code to the remote server by running the following command
9. Source code will now appear in the Azure DevOps (destination) ref: step # 2 https://dev.azure.com/DepartmentName/RepositoryName/_git/RepositoryName
ACS can help you in various aspects of software development in all phases of DevOps. Just complete the form for a free consultation and we shall be in touch with you to understand your specific requirements.