Here are few things happened when I used “tfsconfig recover” to try to recover my troubled tfs_configuration database. Please backup the database before try it and use it at your own risk. According to Microsoft, you might make some information unrecoverable if you use it the wrong way.

  • Scenario #1 – TFS instance unexpected (Database mismatched)
    • It simplely stop and restart the application and not fix anything
    • You can find this error from the Event Viewer
    • The instance number mentioned in the message is from tfs_configuration (same for other database as well)’s Extended Properties
    • You can actually prep the tfs_configuration database to resolve it.
  • Scenario #2 – Hanging jobs for attaching or detaching the project collection
    • Setting database option CURSOR_DEFAULT to LOCAL for database Tfs_Configuration
    • Setting database option CURSOR_CLOSE_ON_COMMIT to ON for database Tfs_Configuration
    • Setting database option SINGLE_USER to ON for database Tfs_Configuration
    • Setting database option OFFLINE/ONLINE to ON for database Tfs_Configuration
    • Setting database option OFFLINE/ONLINE to ON for database Tfs_Warehouse
  • Scenario # 3 – widget records is missing so TFS lost track

TfsConfig recover /?

Recovers lost Team Projects or Team Project collections after a disaster recovery with loss of data.

TfsConfig   recover /sqlInstances:sqlInstance1[,sqlInstance2,…] |

/configurationDB:sqlInstance;configDB /collectionDB:sqlInstance;collectionDB

This command should only be run after a disaster recovery!

/sqlInstances: Enumerates the databases in the listed sql instances and validates attempts to recover collections and

projects that have been orphaned after disaster recovery. The sqlInstance can be of the form <machineName> or <machine>

\<instance>.

/ConfigurationDB: Indicates where the Configuration Database is located.

/CollectionDB: Indicates which Collection Database to recover. If the configurationDB and CollectionDB parameters are

Advertisements