If you are moving/restoring your TFS database from SQL Server Enterprise/Developer edition to SQL Server Standard edition, you have to disable SQL Server data compression first since this feature is only available in Enterprise/Developer edition. Here has an article on MSDN which shows how to do that: http://support.microsoft.com/kb/2712111
Following is a short excerpt from this article:
To disable SQL compression on a Team Foundation Server 2010 database you can:
- Launch SQL Server 2008\2008 R2 Management Studio
- Locate each Team Foundation Server 2010 database(Configuration and Collection databases), right click on the database and select new Query
- Type: _EXEC [dbo].[prcEnablePrefixCompression] @online = 0, @disable = 1__
- Run (!Execute) the query and verify success under messages
- Repeat steps 1. to 4. for all required databases.
The below SQL query will provide you an estimate about the amount of additional disk space that would be required after compression has been disabled on a Team Foundation Server 2010 database.
_selectsum(used_page_count)* 8 * 2 /1024.0
fromsys.partitions p
joinsys.dm_db_partition_stats s
on s.partition_id = p.partition_id
and s.object_id= p.object_id
and s.index_id = p.index_id
where p.data_compressiondesc =‘page’
Note:
- The size returned by the above sql query is in Megabytes(MB).
- You should run this query against each Team Foundation Server 2010 database(Configuration and Collection databases) before disabling data compression.
- The SQL query should be run in the context of each Team Foundation Server 2010 database separately.