Sometimes you may want to clone your collection for many reason, we can use the following command:
1
C:Program Files\Microsoft Team Foundation Server 12.0\Tools>tfsconfig collection /attach /collectionName:ClonedFabrikam collectionDB:vsalmSQLExpress;TFS_FabrikamFiberCollection /clone
And remember:
- You will need to detach the collection first and make a copy of the DB
- The /clone switch didn't actually clone DB it just telling TFS Admin Console this is a cloned collection so please don't start it :-)
Note 1: It's important to know that you can't start the cloned collection until you delete the projects from the original or the cloned collection, so you can't keep projects on both collection, otherwise you will face the following error:
TF253021:The following team project is duplicated in at least two team project collections: The collection cannot start while the duplication exists. You must delete this project from all but one of the collections before the collection can be started.
The project exists in the following collections:
Note 2: It's Important to know that you must detach the collection otherwise it will not appear when you try to attach, you can make the backup without detach if you are making upgrade from old version like 2010 or 2008.
Note 3: For not detached collection you can use
option but this only for TFS2010 but [don't use it with TFS2012 or TFS2013 as it's deprecated] Fore more information: