Search code examples
tfsdatabase-restoredata-recovery

How do I get back TFS(2010) data after I uninstalled it by mistake


How do I get back TFS(2010) data after I uninstalled it by mistake?

I have SQL Server backups for TFS_Configuration, TFS_Warehouse, TFS_ProjectName1 and TFS_Analysis databases.

I installed a new TFS and now I have new TFS_Configuration, TFS_Warehouse, TFS_NewProjectName and TFS_Analysis databases but I want back the old data from previous TFS.

I try to follow the steps from http://msdn.microsoft.com/en-us/library/ms404869%28v=vs.100%29.aspx but now I'm stuck trying to restore the databases from backups (I get verification errors before restore start, that said the databases are different). What should I do?

The main goal is to recover the content files of the old TFS. What options do I have? Is it possible to programmatically read (to a local folder) the old TFS data?(Which table should I read? In this way I recovered the documents stored in WSS_Content)

Please help! We don't have any data to work with.


Solution

  • Here are the steps I followed and the problems that I encountered:

    • I used "Restore Data to the Same Location" http://msdn.microsoft.com/en-us/library/ms252458.aspx
    • After I uninstalled TFS I backed up and removed all TFS databases from SQL Server: TFS_Configuration, TFS_Warehouse, TFS_ProjectCollection, ReportServer, ReportServerTemp. (I didnt do a backup but I deleted TFS_Analisys from SQL Server Analysis instance)
    • I uninstalled SharePoint and then I tried to install it back but I failed. The solution was to remove WSS_Content from SQL Server, then the install succeeded.
    • I installed a fresh TFS (without creating the TFS_ProjectCollection)
    • Errors at Reporting Services occurred.(because I deleted ReportServer, ReportServerTemp). were solved using Reporting Services Configuration:Open Database tab ->ChangeDatabase->Create new Report server database ...continue with default options.
    • I restored the ReportServer, ReportServerTemp from backups.
    • After TFS install, I stopped TFS Services: TFSServiceControl quiesce, then I restored in SQL Server the TFS databases from backups (with OVERWRITE option)
    • I rebuilt only analisys service:

    TFSConfig RebuildWarehouse /analysisServices Update All Service
    Accounts TfsConfig Accounts /add /AccountType:ApplicationTier
    /account:YourTFSServicesAccount /password:YourTFSServicesPassword
    /SQLInstance:YourSqlServer /DatabaseName:TFS_Configuration

    TfsConfig Accounts /add /AccountType:ReportingDataSource /account:YourTFSServicesAccount /password:YourTFSServicesPassword /SQLInstance:YourSqlServer /DatabaseName:TFS_Configuration

    • Clear the Data Cache on Servers
    • Register Tfs_Configuration

      TFSConfig registerDB /SQLInstance:YourSqlServer /DatabaseName:Tfs_Configuration
      TFSServiceControl unquiesce

    • From SQL ServerConfiguration Manager: start services you need (Analysis Services)

    • From Services start SQL Reporting Services