Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
277 views
in Technique[技术] by (71.8m points)

.net - Team Foundation Server: Cloning a Collection's Project into a new Collection

We are looking to create a new Team Foundation Server Collection for the next version of our application development. The source from our current version will largely not apply, except for a few DLLs which should more or less remain unchanged. We wanted to make a new collection but were wondering if we would be able to clone the DLL projects from our existing collection to retain history.

Is this possible? We realize this could bring up some "Dual Maintenance" issues if there are any bugfixes needed for the DLLs, but we are not too concerned about that scenario.

So far, I have come up with a few resources. Some MSDN posts were pointing people towards Splitting a Team Project Collection. The issue there, however, is that you can only have one project in each collection. IT states:

A project cannot exist in more than one collection. Until you delete all duplicated projects between the split collections, you will not be able to start the renamed collection.

That is not really what we want. We would like to maintain both projects with history in each collection.

Otherwise, I saw the TFSConfig command. It contains a /clone option, but I am not quite sure of its usage (additional examples are also hard to come by) and it mentions that it is primarily used for splitting as well.

Are we looking to do something that isnt possible? Would we need to copy the source and add it as a new project in the new collection and refer to the old collection if we really need history? Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

As other commenters have suggested, you probably don't want to start a new Team Project Collection for this purpose.

The normal reasons against creating a new TPC are:

  1. Sharing code or work items between two Team Project Collections is very difficult. It's almost as if you're connecting to a new server.
  2. Unless your project is so big, that you might need to move the collection to it's own SQL server in the future, there's not a lot of value in a new TPC

However, if you did decide that you want to create a copy of an existing TPC on the same server, these are the general steps to follow:

  1. Open the TFS Admin Console, go to Team Project Collections
  2. Select your existing collection and choose 'Detach Collection'
  3. Wait for the detach to complete. This procedure copies the "shared" data out of the configuration database (like groups/identities) and stores it in the collection database.
  4. Once the detach is complete, backup the databse in SQL
  5. In the admin console, choose 'Attach collection' and choose the database that you just detached & backed up

These steps can then be performed on the same server (or another server, if you want to move it there)

  1. Restore the database backup, with a new database name
  2. In the TFS Admin Console, choose 'Attach collection' and choose the database that you just restored.
  3. TFS will look at the GUID of this database (stored as an extended property), it will see that it is the same as a currently running collection on the server, and automatically give it a new GUID.
  4. At this point, you should have two collections running.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...