Connecting to TFS 2008 database from Business Intelligence Studio 2005 - tfs

This is a beginner question, I have to create some SQL Reports with business intelligence Studio 2005, but I don't have any idea how to connect to the TFS server 2008 Database.
These are my doubts:
how to get the TFS DB server name, whether this will be different from TFS server name.
What all user permissions are required for working with the DB and which database of TFS 2008 should i connect to.
Whether Business Intelligence Studio 2005 supports creating reports for TFS 2008.

A normal TFS 2008 installation consists of multiple DBs on a single SQL Server. For the name of that SQL instance you need to ask your administrator.
For reports you want to use the TfsWarehouse DB. This DB also feeds a SSAS cube (again, ask your admin for the instance name), which can also be used for reports.
You need read permissions (data_reader on SQL Server) on one or both to create reports against it. Using BI Studio 2005 should not be a hindrance.
A word of caution: The warehouse structure has changed significantly with TFS 2010, so your reports will require some rework when you change.
Check out this blog for additional info on custom TFS reports and the warehouse structrure.

Related

MIgrate from TFS 2010 to TFS 2013 without reporting services backup

I am planning my migration from TFS 2010 to TFS 2013. I am using the guide at http://vsarupgradeguide.codeplex.com/downloads/get/755804#
Currently my TFS 2010 server has a reporting services instance installed with the required databases:
Tfs_Warehouse
Tfs_Analysis
ReportServer
ReportServerTempDb
Can I migrate to a new TFS 2013 server without backing up / restoring the reporting services? Basically not installing reporting services and then just later on installing a new instance of reporting services?
Will this work or will the migration process fail? Will I lose any functionality if I do it this way?
If you switch over to a new instance of reporting services without backing up the database and the encryption key from the old one, you'll lose any custom/modified reports, as well as have to re-apply security settings. Other than that, there's no harm in it.
The warehouse and analysis databases are not part of reporting services, they're the TFS warehouse and analysis cube databases. They're created by TFS.
The ReportServer database is the one that holds all your reports.

Using TFS 2010 Source Control with SQL Server 2012 SSMS to manage SQL Scripts

I have an ongoing need to manage, in TFS source control, a collection of SQL scripts organized as an SSMS solution (.ssmssln file).
I'd like to capture the "success path" for using SQL Server 2012 SSMS with TFS2010, using the appropriate MSSCCI provider and Team Explorer versions and install sequence.
I'm using the "Developer Edition" of the SQL Server products, running locally on my Win7-64 dev box, and need to access a TFS 2010 server maintained by a different group. VS2012 and VS2013 are also installed on this "new" dev box and I have had no problems accessing our TFS 2010 server from them.
I had been trying to get SSMS from SQL Server 2012 (Developer Edition) to work with our TFS Server 2010 for some time, with no luck. I finally did get the SSMS 2012/TFS 2010 combination to work on the new dev box, but was left with the question "what was it that actually worked", and none of the other documented solutions address this combination. This one doesn't:
See: SQL Server Scripts 2012 Project into Team Foundation Server 2012, which addresses SSMS 2012 and TFS 2012.
My company's TFS versions tend to lag 1 major version behind our VS and SQL versions.
Other articles did not have steps that solved my problem.
https://dba.stackexchange.com/questions/17850/tfs2010-for-ssms-2012; the 2010 Team Explorer plus 2012 MSSCCI provider did not work for the SSMS 2012 + TFS 2010 combination. This article, http://www.techtree.co.uk/sql-server/management-studio-ssms/use-team-foundation-server-tfs-as-your-source-control-in-ssms/, while helpful, didn't really discuss the Team Explorer requirement except briefly in comments from others.
I had the SSMS 2008R2 and TFS2010 combination working fine on an older box using the MSSCCI provider. When I moved to a new box, installed SSMS from SQL Server 2012, and would open and edit my SSMS solutions (opening the .ssmssln files) I was not having any luck in getting integrated TFS source control to work, despite trying a number of different MSSCCI provider versions and TFS Team Explorer versions.
From SSMS2012, I would get the "Connect to a Team Foundation Server" dialog box, with an empty dropdown list of TFS servers, and then attempt to add my company's server, and inevitably get a 404 error, despite entering the same values that worked for SSMS 2008R2/TFS2010 on my older Win7-64 box.
The combination that I believe finally worked for me was:
Install Team Explorer for Visual Studio 2012
http://www.microsoft.com/en-gb/download/details.aspx?id=30656
Install MSSCCI Provider for Team Foundation Server 2010 https://visualstudiogallery.msdn.microsoft.com/bce06506-be38-47a1-9f29-d3937d3d88d6
After doing these two things, I recall getting a prompt to open Team Explorer. I believe it was launched for me either after installing the MSSCCI 2010 provider or when I went to configure source control in SSMS 2012.
Interestingly, when Team Explorer launched, it showed "the Visual Studio 2010 logo." In any case, I opened it, and went to add the TFS servers. This time, there was an additional entry in the add servers box, that showed the TFS "initial path" (or "instance name") for our TFS 2010 server.
Our TFS server address appears to be:
http://OurTFSServer:8080/tfs
Previously, there had been no place to enter the "/tfs" part of it. This time, it showed up in the add TFS server address dialog box, and I believe was prepopulated for me.
It appears to me that the missing part was the install of the VS2012 Team Explorer, which seems to know about the "/tfs" initial path, where the VS2010 Team Explorer did not. Strangely, the Team Explorer that launched showed the VS2010 logo; note that I explicitly uninstalled the VS2010 Team Explorer prior to the sequence of installing VS2012 Team Explorer and then installing the TFS 2010 MSSCCI Provider.
Just to keep things interesting, the MSSCI provider version numbers and dates are confusing. Here is what the "readme.txt" file says for the MSSCCI version numbers. The file is located at:
Program Files (x86)\Microsoft Team Foundation MSSCCI Provider\readme.txt
NEW system:
Microsoft Team Foundation Server MSSCCI Provider
v 3.5 09/20/2013
OLD system:
Microsoft Team Foundation Server MSSCCI Provider
v 4.0 03/07/2012
So it appears the combination that was working on my "old" dev box for SSMS 2008R2 and TFS2010 was the Team Explorer for Visual Studio 2010, and the MSSCCI Provider for Team Foundation Server 2012. I also had VS2010, VS2012, and VS2013 installed on that box.
On the "new" box, it appears the working combination for SSMS 2012 and TFS2010 is Team Explorer for Visual Studio 2012, and the MSSCCI Provider for Team Foundation Server 2010 (which has an older version number but a newer build/release date, compared to the 2012 MSSCCI provider).
What I am looking for is others who use this combination, SSMS 2012, and TFS 2010, to confirm and/or clarify the "success path" of what is required and the sequence, based on their experience from ACTUALLY GETTING THIS COMBINATION TO WORK. Not what "should" work (and often doesn't), but what DID.
This problem was resolved on several fronts, over time, by migrating to better-fit technologies, and updating to known-compatible versions of the Microsoft technologies involved.
1) I changed most of the SQL script content to JSON files, by serializing the data with Newtonsoft's JSON.NET. Now I no longer had a need to maintain these SQL scripts. Instead, I load the data from JSON files, to objects, having implemented serialize/deserialize approaches within the applications that use the data. This works out way better than SQL since the bulk of the data that was being kept involved representations of "content".
The content is represented as packets of documents, with each packet containing multiple document templates, and each template being comprised of multiple paragraphs. There are additional properties of packets, templates, and paragraphs up and down the object model. So JSON serialization/deserialization was a way better fit for these applications. It also enabled a "single piece flow" approach to updating content. Now I manage JSON files instead of SQL scripts, to keep point-in-time snapshots of these content objects. Typically I will back up the prior version of all the document packet objects as part of each content release, and store that backup in TFS.
2) There were other areas where I still need to maintain SQL scripts, such as reusable queries within the application. (I didn't want to use stored procedures for configuration flexibility reasons) I found an approach for making these SQL queries part of a .NET assembly via Resource Files and that addressed the need. One example of the type of approach I used is here: https://jopinblog.wordpress.com/2007/11/12/embedded-resource-queries-or-how-to-manage-sql-code-in-your-net-projects/
3) My company upgraded our TFS Server to TFS 2012 and we started using Visual Studio 2012 and 2013. The things that had been problems in SSMS started working when using newer known compatible configurations.

TFS Collection Migration from 2010 to 2012

I have two TFS servers. One is a legacy TFS2010 server that contains an old collection of our projects. Last year, we spun up a new TFS2012 server. However, we never migrated our source code from the old server (we treated it as a fresh install and created new projects).
We are now looking at retiring the 2010 server completely and I want to migrate the legacy 2010 collection (actually all I care about is the source control and history) to the new server as a separate collection, but I can't figure out how. I've followed the instructions on MSDN (http://msdn.microsoft.com/en-us/library/vstudio/dd936138.aspx) but when I get to the step for attaching the collection on the new server, TFS complains that "no attachable databases were found" on the sql server.
I've also tried running the "tfsconfig Collection /attach" command on the target TFS server (even though numerous posts I read say it was deprecated in 2012). It tells me it can't connect to the target database server (even though my production collection is attached to it on that box).
Does anyone know if a collection migration from 2010 to 2012 is even possible or if I'm just spinning my wheels? There's no official documentation from Microsoft that I can find that says such a migration is even possible (even though there's nothing I can find that refutes it either)
Server Specs:
Old SQL Server: Enterprise 64 Bit 2008 SP3 (10.0.5500)
New SQL Server: Enterprise 64 Bit 2008R2 SP2 (10.50.4000)
Old TFS Server: 10.0.40219.1 (SP1 KB2182621)
New TFS Server: 11.0.60315.1 (TFS2012 Update 2)
You can migrate a single collection. The steps I know working are:
detach the collection from the 2010 instance using TFS Admin console
backup the database (or detach from SQL)
restore the database new SQL instance (or copy the files and attach them from SQL) -- check does not clash with existing database names
attach the collection from the 2012 TFS Admin Console
The last step will kick off the upgrade process: the collection will not be available until the process is complete. It could takes minutes or hours depending on the size, and make sure you have enough space for SQL transaction logs.
Take a look at Team Foundation Server Integration Tools (March 2012 Release): http://visualstudiogallery.msdn.microsoft.com/eb77e739-c98c-4e36-9ead-fa115b27fefe
The TFS Integration Tools is a project developed by the Team
Foundation Server (TFS) product group and the Visual Studio ALM
Rangers to integrate Team Foundation Server with third party systems
for migration and synchronization of data.
There is a migration guide for TFS 2010 to TFS 2012 located here: https://upgradetfs2010totfs2012.codeplex.com/
it may be faster in some cases depending on the size of the projects that need to be moved (and the number) to start by importing the latest code into the existing version of 2012 since you are concerned only with moving the source code. You do loose the history however.
Do a in-place migration, described in Team Foundation Server Upgrade Guide, from Microsoft ALM Rangers (http://vsarupgradeguide.codeplex.com/), and next migrate the collection to the new server. From 2010 to 2012 it's a very simple migration.
Don't forget backup the databases before doing a in-place migration.

How can I use the TFS Power Tools Backup/Restore feature to restore an entire TFS installation from one server to another

I have TFS 2010 on an existing server and want to move it to a new server. I would like to keep all of my collations intact and make the move as smooth as possible. I would also like to use the Power Tools backup/restore feature to do this. I have backups now in a network location so how can I reliably restore these onto my newly installed and patched TFS 2010 box (with no configuration)?
Moving a TFS instance to a new server is a delicate procedure. The TFS Configuration database contains a lot of URI's, service accounts and other important information.
You can quickly restore a TFS backup to the same server, without issues. To actually move to different hardware or a clean installation, follow the following (lengthy) procedure. You can use your existing backups.
+1 for #jessehouwing
But if you have the same URI's, you can do the following
After you back up TFS 2010 using TFS Power Tools 2011, then you restored the TFS 2010 back up to another SQL Server or instance, or restored in the original SQL Server which your TFS 2010 configured?
If you want backup TFS 2010 using TFS Power Tools and restore to the original SQL Server, please refer to the detailed steps in this article: http://myalmblog.com/2010/09/12/tfs-2010-power-tools-tfs-backup-and-restore-hands-on-lab/.
If you want to backup TFS 2010 and restore to another SQL Server or instance, after restore TFS 2010 database on the new SQL Server, you need to configure the new SQL Server for your TFS 2010, please refer to the detailed steps in this document: http://msdn.microsoft.com/en-us/library/ms252516.aspx.

Team Foundation Server 2008 managing Sql Server 2005 & 2008 database changes

Does anybody have any recommendations for managing database changes with Team System 2008 and Team Foundation Server 2008? I am a developer for my company and was hoping to achieve source control over the database stored procedures, triggers, tables etc... with TFS 2008.
We are currently using TFS 2008 to manage our source code for our .Net projects. We have Visual Studio Team System 2008 that contains the Architecture Edition, Database Edition, Development Edition and Test Edition. I am not really familiar with the capabilities of the Database Edition.
I really appreciate any recommendations.
Just to let you guys know we will be using this for source control over 2005 and 2008 sql server databases. Thanks.
We have been using DB Ghost for out database change management. It does a good job capturing the entire database. They have a recommended flow for starting out and getting your db in source control.
That said, if you already have Team Suite, I would recommend using the built in tools. Here is a link to the MSDN Getting Started type info for Team Edition Database.
Good luck, and congratulations on making the decision to version your database. It is a challenging process, but a very important one.
With the database edition you can easily import you database objects and add the objects into source control. When you develop your database, you can do that from within the database project and then deploy the changes to sql server.
See also the Database Guide from the Visual Studio ALM Rangers: http://vsdatabaseguide.codeplex.com/

Resources