Answered by:
Error TF246081 when i try to attach Collection Database in TFS 2013

Question
-
Hi!.
We are trying to attach our TPC in TFS 2013 after moving it to another SQL Server (same version, SQL Server 2012)
If we use Team foundation server administration console and we try to list available database, no one appear in the list.
if we run this command
TFSConfig Collection /attach /collectionName:TPC1 /collectionDB:Server;Database1
we receive this error:
TF246081: An error occurred while attempting to attach the team project collection. The collection was not detached properly. Either the collection was not detached using the correct tools, or the detach operation did not complete successfully. You must detach this collection successfully before you can attach it to a deployment of Team Foundation Server.
Any ideas?
Thanks
- Edited by Rodrigo Melendez Tuesday, June 17, 2014 11:11 PM
Tuesday, June 17, 2014 11:06 PM
Answers
-
Daniel, your step #1 is missing the whole point. This is a DISASTER RECOVERY where the backup jobs were configured in the TFS Admin console, backups run successfully, and then the TFS App Tier crashes
hi Alex
you've never written that it is a disaster recovery.
In this case the situation is different but not hopeless.
Try John's last answer (October 16, 2014 7:15 AM) in this posting TFS 2013 error after the project collection move from TFS 2012.
you need to restore all databases (except system database msdb, master etc.) to the new TFS Server
Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
- Marked as answer by Rodrigo Melendez Wednesday, January 14, 2015 6:54 PM
Thursday, October 30, 2014 5:52 PM
All replies
-
Hi,
Thanks for your post.
As far as I know, you must first detach the team project collection from its original collection and then back up its database before the move. Did you detach the team project collection properly?
Please refer to the article below to move one team project collection:
http://msdn.microsoft.com/en-us/library/vstudio/dd936138(v=vs.110).aspx
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Wednesday, June 18, 2014 9:44 AM -
I used "Scheduled Backups" from TFS admin console.
Thanks.
Wednesday, June 18, 2014 12:05 PM -
I found this post: https://gyorgybalassy.wordpress.com/tag/visual-studio/
My database dont have "TFS_SNAPSHOT_STATE" properly value. but i can´t take backup again. So, how i need to do to modify this value? its possible?
Regards
Wednesday, June 18, 2014 8:49 PM -
Hi,
Was your original TFS still there? If the original server is there, you can detach the collection DB and back it up again.
Or you can try to recover your original server with the backup, then detach and back up again.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Thursday, June 19, 2014 9:11 AM -
No. I can't back up it again. I need to recover this database.
In TFS 2012 we had "tfsconfig /recover" command, but not exist in 2013...
Thursday, June 19, 2014 2:49 PM -
Hi,
I am going to report your case to our senior engineer to further look at this issue.
There might be some time delay. Appreciate your patience.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.Friday, June 20, 2014 7:42 AM -
Any Update?
Thanks
Saturday, June 28, 2014 2:43 PM -
The database needs to be detached before you can attach it.
Since you have made backups periodically, you can restore your database first your backups to detach it.
Please refer to the following articles for instructions about restoring database in TFS 2013:
http://msdn.microsoft.com/en-us/library/hh529829.aspx#RestoreDBs
Wednesday, July 9, 2014 8:20 AM -
Sandy, your instructions DO NOT solve this issue. I'm stuck in the same situation as Rodrigo. Here are the steps so far:
1. The TFS 2013 backups (as configured in TFS Admin Console) have been running successfully.2. The Team Project Collection gets detached in the TFS Admin Console.
3. The database gets restored using the TFS Admin Console's Restore procedure.
4. I try to attach using the TFS Admin Console (but it doesn't find the database) and using the tfsconfig.exe collection /attach command (but it gets this Error TF246081).
The database is restored right back to the same database instance as the rest of the TFS farm's configuration and other collections. It appears to be a successfully-restored database. The collection is NOT in the list of currently attached collections. I can't go back in a time machine to undo anything so your suggestion that we should detach is moot. Please keep in mind that this is a "disaster recovery" exercise with TFS 2013. So how does TFS 2013 handle this?
Wednesday, October 29, 2014 7:43 PM -
1. The TFS 2013 backups (as configured in TFS Admin Console) have been running successfully.2. The Team Project Collection gets detached in the TFS Admin Console.
3. The database gets restored using the TFS Admin Console's Restore procedure.
4. I try to attach using the TFS Admin Console (but it doesn't find the database) and using the tfsconfig.exe collection /attach command (but it gets this Error TF246081).
hi Alex
you need perform the following steps:
1. detach the TFS collection first ni TFS Admin Console on TFS Server #1
2. backup the SQL database used by the TFS collection
3. reattach the TFS collection to be available online again.
4. restore the SQL backup from step 2 on the other server used by TFS Server #2
5. attach the TFS collection using TFS Admin Console on the TFS server #2
depending on the location of TFS Server #2 you need to change the server id otherwise you get some issues when clients are accessing both TFS servers.
Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
- Edited by Daniel_Steiner Thursday, October 30, 2014 12:23 PM
Thursday, October 30, 2014 12:22 PM -
Daniel, I should've started off my Wednesday, October 29, 2014 7:43 PM comment clearly explaining that this was a Disaster Recovery scenario. In this scenario the backup jobs were configured in the TFS Admin console, backups run successfully, and then the TFS App Tier crashes where its impossible to get back up-running without first doing a restore of database(s). Now do you or anyone have a suggestion?
- Edited by Alex Trimble Degaston Thursday, October 30, 2014 8:37 PM clarification that this is a Disaster Recovery scenario
Thursday, October 30, 2014 2:45 PM -
Daniel, your step #1 is missing the whole point. This is a DISASTER RECOVERY where the backup jobs were configured in the TFS Admin console, backups run successfully, and then the TFS App Tier crashes
hi Alex
you've never written that it is a disaster recovery.
In this case the situation is different but not hopeless.
Try John's last answer (October 16, 2014 7:15 AM) in this posting TFS 2013 error after the project collection move from TFS 2012.
you need to restore all databases (except system database msdb, master etc.) to the new TFS Server
Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
- Marked as answer by Rodrigo Melendez Wednesday, January 14, 2015 6:54 PM
Thursday, October 30, 2014 5:52 PM -
Daniel, your step #1 is missing the whole point. This is a DISASTER RECOVERY
hi Alex
you've not written that it is a Disaster Recovery Scenario.
in this case it is a different situation but not hopeless.
please follow John's last answer (October 16, 2014 7:15 AM) in this posting TFS 2013 error after the project collection move from TFS 2012
you need to restore all TFS databases.
Please use Mark as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
- Proposed as answer by Alex Deg Friday, November 7, 2014 2:07 AM
Thursday, October 30, 2014 6:55 PM -
I think John's last answer (October 16, 2014 7:15 AM) may be the solution as its plausible. I'll setup an environment to try this out and let you know. Thanks Daniel.
Edited to add: yes this solution is the answer and thank you very much.
- Edited by Alex Trimble Degaston Friday, November 7, 2014 2:10 AM confirm answer
Thursday, October 30, 2014 8:39 PM