Hello,
When restoring a TFS/Azure DevOps Server project collection, simply restoring the database in SQL Server Management Studio (SSMS) is not enough. The TFS/DevOps application tier expects the database to be registered and attached in a very specific way. That’s why your DevOps server cannot recognize the collection database.
To recover your .NET source code, here are the supported options:
- Use the TFS Admin Console to Attach the Collection
- Open TFS Administration Console on your Azure DevOps/TFS server.
Navigate to Team Project Collections → Attach Collection.
Point it to your restored database.
This process runs validation, upgrades schema if needed, and formally registers the collection.
If the DB version is older/newer than your server version, you’ll need to install the matching TFS/Azure DevOps Server version before attaching.
- If You Only Need Source Code (Not Full TFS)
If your main goal is just to recover the .NET source files and not the full TFS environment:
Restore the collection DB in SSMS.
- You can query the tbl_VersionControl tables in the database (not officially supported, but technically possible) to extract file contents.
However, this is painful and unsupported.
Instead, use the official TFS Integration Platform or install a matching version of Azure DevOps Server (on-prem), attach the collection properly, and then use Team Explorer/Visual Studio to get the latest source code.
- Important Notes
- You must restore all related databases (Configuration DB + Collection DB + optionally Warehouse/Analysis if you need reporting).
TFS collection DBs are not standalone – attaching only one DB will fail.
Versions must match: if your backup is from TFS 2017, you need TFS 2017 to restore and then upgrade step by step.
Additional Reference:
- Restore databases to recover data in Azure DevOps Server/TFS
- Move or restore TFS project collection databases
I hope the above information helps, to exactly troubleshoot further please help us with requested information to check and assist you further on this. Thank you!