0
votes

I was careless not to detach the collection from TFS admin. Now I reinstall Windows, how can I restore the collection back ?

I get the old db restored back on the sql server, but cannot attach it on TFS admin. "No attachable databases were found on the following instance of sql server..."

The current sql server and the old server have different instance name. I try the following command to register the old db(restored already on sql server) back to the tfs collection but it fails for no reason.

TFSConfig RegisterDB /SQLInstance:currentserver /databaseName:Tfs_MyoldDB

show error: The following exception was caught while trying to validate the database: TF30040: The database is not correctly configured. Contact your Team Foundation Server administrator.

Thanks.

2

2 Answers

2
votes

Do you have the original tfs_config databases? The one where the collection database was attached?

If you do, you can simply uninstall TFS (or use "tfsconfig.exe setup /uninstall:ApplicationTier" from the command line) restore the original tfs_config and collection database and then from the TFS console perform an upgrade or add a new application tier. This will reconfigure using the existing un-detached collection. This will ask you which DB instance to use and pick up the rest from there.

0
votes

If databases have not changed in content, but the SQL instance is different you should use the RemapDBs command

TfsConfig.exe remapDBs /databaseName:NEW_SQL_INSTANCE;Tfs_Configuration /sqlInstances:NEW_SQL_INSTANCE