0

We have a database project in TFS which lives in its own solution and has Dev, UAT and Prod branches. The project includes many different schemes which reside in one DB once deployed.

A decision was made to move one of the DB schemes entirely into its own DB, therefore I will have to create a separate solution and project for that schema.

How can I do that in TFS so that the existing history of every object is preserved after this migration?

Here's what I currently have:

MyDB_Dev
    SchemaToMove
    SchemaToStay
MyDB_UAT
    SchemaToMove
    SchemaToStay
MyDB_Prod
    SchemaToMove
    SchemaToStay

Here's what I need to arrive at:

ANewDB_Dev
    SchemaToMove
ANewDB_UAT
    SchemaToMove
ANewDB_Prod
    SchemaToMove
MyDB_Dev
    SchemaToStay
MyDB_UAT
    SchemaToStay
MyDB_Prod
    SchemaToStay
ajeh
  • 2,652
  • 2
  • 34
  • 65

1 Answers1

1

Looks like you just want to move the files in source control and keep history. In TFS , to move folders or files that are referenced by a Visual Studio project or solution, you could move these files with Solution Explorer and check in the move in a new changeset. You won't lose history with this action.

You could also use Rename Command (Team Foundation Version Control) which changes the path of a file or folder. Sample:

c:\projects>tf rename 314.c ..\newdir\1254.c

A simialr question: Moving multiple files in TFS Source Control


Update

If you are moving files between projects, you have to unload the Project/Solution and move the files in Source Control Explorer. You can only move one file/folder at a time*. Then you have to reload the projects and Exclude the files from the old one and Include them into the new one.

Details take a look this similar tutorial: Moving files between projects in TFS

Community
  • 1
  • 1
PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62
  • Unlike in VSS, TFS does not seem to have d'n'd support. As my move is from one solution to another, dragging in Solution explorer does not seem to work either. So the only way I guess is to create a new solution and use command line on the local file system to rename the items? – ajeh Jan 18 '17 at 14:57
  • Why you want to use local file system to rename the items? If you are moving files between projects, you have to unload the Project/Solution and move the files in Source Control Explorer. You can only move one file/folder at a time*. Then you have to reload the projects and Exclude the files from the old one and Include them into the new one. Details take a look this similar tutorial: https://alexmg.com/moving-files-between-projects-in-tfs/ – PatrickLu-MSFT Jan 18 '17 at 15:44
  • The rename command is used for changing the **TFS server path** of a file or folder. Not really rename the item's name. There also has been a related uservoice: https://visualstudio.uservoice.com/forums/121579-visual-studio-ide/suggestions/2801140-move-a-file-in-tfs-which-is-dragged-from-on-proje – PatrickLu-MSFT Jan 18 '17 at 15:54
  • What I want is to follow a correct process which I am having to piece together from the little bits here and there. – ajeh Jan 18 '17 at 16:02