Monday, 29 October 2012

TFS Server Backup Restore


Backing up and Restoring a TFS Server

Backing up and restoring a TFS server can be daunting.  There are potentially a lot of services and a lot of steps. The Power Tool would greatly simplify backing up and restoring a TFS server. 
The more complicated your deployment, the more complicated it’s going to be.  For the purpose of this discussion I’m going to focus on TFS Basic users because the simplification there is the greatest but this Power Tool can help simplify the process for many users.
Let me walk you through the new backup experience while telling you a bit about what it does.

Configuring a Backup Plan

After installing the next Power Tools release on your TFS 2010 server (yes, this only works for TFS 2010), you will notice that there is a new tab in the admin console called “Team Foundation Backups”.  When you click on it you will see a screen like this that allows you to begin the configuration of your TFS backup plan.
Backup1
If you click “Create Backup Plan”, it will launch a wizard to guide you through the process.  Here’s what the wizard welcome page looks like:
Backup2
Clicking Next gives you the first page where you enter the location for backups and the # of days you want to keep backups around for (it will automatically delete backups older than this).  Of course you can delete backups yourself if you want to too – they are just files in the specified directory.
Backup3 
Click Next again and you can provide the account that will run automated backups and see what SQL permission that account will need.  As you’ll see later backups don’t have to be automated but they can be.
Backup4 
Click Next again and you can configure the backup service to send you emails about any failures in the backup process.  In this case, I didn’t have my TFS server configured with an SMTP host, so my only option was No Email Alerts.  This uses the same email host and from address that other TFS notifications use, only the recipient can be specified here.  If you want more than one recipient, you can separate them with commas.
Backup5
Click Next again and you can configure the schedule.  The default is to run every night and do a full backup of your TFS.  For small TFS installations, this is a simple and sufficient backup strategy.  Choosing this option will run the full backup at 2:00AM every morning.  If you want more control than that, you can click the Advanced Schedules Options.
Backup6.1
If you choose Advanced Schedules, you get two more options 1) a Full, Differential and Transactional Schedule and 2) a Manual Backup Only option.  If you choose manual backup only, it will not run any backups automatically but rather only perform a backup when you run the admin console and click the “Take Full Backup Now” button (more on this later).  Here I have chosen the Full, Differential and Transactional schedule – this is a pretty typical enterprise kind of backup strategy.  I have configured it to do a full backup every Sunday at 2:00AM, a Differential (sometimes called incremental) backup every other day of the week at 2:00AM.  And a transactional backup every 15 minutes.  This means I should never lose more than 15 minutes of data yet the performance and storage cost for this is quite modest.  This is something that is totally cool about SQL’s backup capabilities.
Backup6.2
Once I’ve configured my schedule, clicking Next lets me review my settings.
Backup7
Clicking Next again will verify that the settings I’ve provided should work.  You don’t want to have to wait until 2:00 AM the next morning to find out you fat fingered something :)  In this case I get a warning because I already had a backup plan configured and I’m overwriting it.  This tool only supports one backup schedule per TFS server.
Backup8
Clicking Configure will make all of the changes necessary to configure your TFS server for backup.
Backup9
Click Next again and you are done!  Your server is fully configured for backups (compare that to the docs :)).
Backup10

Taking a Backup

Of course, if you’ve created a schedule, backups will happen automatically at the specified time but I really can’t show you cool screen shots of that – there’s nothing to see :).  Regardless of whether you’ve created a schedule or not, at any time, you can manually take a full backup.  Once a backup plan has been configured, the panel for Team Foundation Backups will look more like this.  It will show you many of your settings and provide a set of administrative actions (on the right).
Backup20
If you click Take Full Backup Now, it will perform a back up and put it in the file system location specified in the plan.  That’s it, it’s that easy!
Backup21

Restoring a Backup

Restoring a backup is a bit trickier and it depends on exactly what you are trying to do.  There are two basic scenarios that we enable:
1) Restore one or more Team Project Collections (but not the whole server).  You would do this if one team screwed up their database and wanted it restored but all the other teams using the server don’t want to be interrupted.
2) Restore the entire Team Foundation Server data (maybe you lost the data drive).
The process is mostly the same but I’ll call out a few differences.  Please take these steps only as demonstrative and look at the docs that come with the Power Tools to get a more thorough understanding of what you need to do based on your configuration.
The first thing you have to do is get the server ready for the restore.
If you are restoring the whole server you should go to a command prompt and run “tfsservicecontrol quiesce” from the Tools directory of your TFS 2010 server installation.  This will shutdown all of the TFS services and release any database locks.
If you are only restoring individual collections, the tool will prompt you to take any collections you are restoring offline and will automatically copy the replaced collection aside.
This tool is conservative.  It won’t overwrite any data.  So, except in the case of restoring individual collections, if you plan to restore a backup of a database that already exists, you must first delete the database.  You can use SQL Server Management Studio or SQL Server Management Studio Express to do this easily.  What I prefer to do is to detach the databases and move them aside but you can also just delete the databases.  All of this can be done using the right click context menu on the database in SQL Server Management Studio.
Now you are ready to restore.  In the TFS admin console, on the Team Foundation Backups tab, you click “Restore Databases”.  This will launch a wizard to walk you through the process.
Restore1
After clicking Next on the welcome screen, you will get the opportunity to browse the list of backups and choose a backup set to restore (based on the date and time of the backup).
Restore2
After clicking Next, you need to choose which of the databases in the set you wish to restore and to which SQL instance you wish to restore them.  By blanking out the “SQL Server” field for a database, it means not to restore that database.  In this case I’m restoring all the databases to the same SQL instance but I could have chosen to restore them to different SQL Instances if this were a multi-SQL server, scaled out TFS server.
Restore3
Click Next again and you can review your choices.
Restore4
Clicking Next or Verify will make sure that the restore is likely to work.
Restore5
Clicking Restore will restore the SQL databases.
Restore6
And finally, clicking Next again shows a victory screen :)  It also includes an “informational warning” that you probably want to go delete the cache on your application tier as well because you don’t want it to be out of sync with the database you just restored.
Restore7
The last thing you must do, if you ran tfsservicecontrol quiesce, is run “tfsservicecontrol unquiesce” to bring the TFS server back on line.

Conclusion

That’s it!  If you’ve done a backup/restore of a TFS server before, you’ll recognize this as being WAY easier.  I didn’t cover every caveat (that’s what docs are for) and as with any backup strategy, don’t count on it unless you’ve tested it.  Make sure whatever you do works – you can back up and successfully restore all of your data and please, please, please don’t torch your system in the process by accidentally reformatting or deleting data you haven’t backed up, etc.  You might even try it all out on a dummy or “pre-production” system first before you try it on a production system with real data.

Monday, 1 October 2012

What is Sprint in Team Foundation Server


Sprint

In product development, a scrum sprint is a set period of time during which specific work has to be completed and made ready for review.
Each sprint begins with a planning meeting. During the meeting, the product owner (the person requesting the work) and the development team agree upon exactly what work will be accomplished during the sprint. The development team has the final say when it comes to determining how much work can realistically be accomplished during the sprint, and the product owner has the final say on what criteria needs to be met for the work to be approved and accepted.
The duration of a sprint is determined by the scrum master, the team's facilitator. Once the team reaches a consensus for how many days a sprint should last, all future sprints should be the same. Traditionally, a sprint lasts 30 days.
After a sprint begins, the product owner must step back and let the team do their work. During the sprint, the team holds daily stand up meeting to discuss progress and brainstorm solutions to challenges. The project owner may attend these meetings as an observer but is not allowed to participate unless it is to answer questions. (See pigs and chickens). The project owner may not make requests for changes during a sprint and only the scrum master has the power to interrupt or stop the sprint.
At the end of the sprint, the team presents its completed work to the project owner and the project owner uses the criteria established at the sprint planning meeting to either accept or reject the work.
See alsoagile development




Plan Your Sprint

In this topic, we cover all major aspects of using the tools available in TFS for sprint planning. We'll begin by creating a sprint backlog. Next, we'll dive into team capacity. Finally, we'll determine what work we can get done in our sprint.

Create Your Sprint Backlog

  1. If you haven't already, create your backlog and specify your sprint schedule.
  2. In your team project's backlog page, drag backlog items into the current sprint.
    Move tasks into the current sprint in TFS
  3. Go to the current sprint's backlog page and add tasks by clicking the + sign to the left of a backlog item.
    Adding tasks to a backlog item in TFS
  4. Name the task and estimate the work in hours.
    Name the task and specify remaining work in hours
  5. After you've added some tasks, your backlog looks something like this.
    What a backlog looks like

Set Your Team's Capacity

  1. On the capacity tab, set capacity in hours per day for each team member.
    Setting capacity per day for team members in TFS
  2. Next, set the team and individual days off.
    Setting days off for individuals and the team
  3. We take care of calculating capacity for you.
    Calculating capacity in TFS
    Here's how we calculate Adam Barr's Capacity:
    First, we calculate the number of working days Adam has left in the sprint. There are 9 remaining days (a), which includes a Team Day Off (b). And, Adam has 4 Days Off (c).
    a - c = 5 working days
    Now we can calculate his capacity by taking the 5 work days x 4 hours per day of capacity (d). Adam has 20 hours of capacity (e) this sprint.
    working days x d = e

Determine What Can be Completed in the Sprint

After we've determined capacity for the whole team, we know what we can get done and we are ready to change the State of our accepted work to Committed. Changing it to this state removes it from the backlog.
Information will begin to show up under Work Details on the right side of Sprint 1. There are three different colors and this is what they mean:
Making assignments from the backlog
Note that the term Committed is specific to Scrum. For MSF for CMMI Process Improvement 6.0 and MSF for Agile Software Development 6.0, Active or Resolved are comparable to Committed.
    1. Open a task in the current sprint. Assign the task to Adam Barr. Or, if you don't assign work to individuals, you can assign the activity.
      Making assignments from the backlog
    2. Once all of your assignments are completed, you can look at the work in the way that makes the most sense for how you manage your projects. There's a view of the work by team member.
      A view of the by team member
    3. You can also look at the work by activity.
      A view of the work by activity type
    4. And, you can look at the total work to which the team has committed.
      A view of work for all team members
So, we've looked at how to create a sprint backlog, capacity planning, and have a good sense for how much work can be accomplished. In addition, we can look at work in several way: across the team, by individual, and even by activity type.


Tuesday, 18 September 2012

Team Foundation Server 2012

Team Foundation Server


                   Visual Studio Team Foundation Server 2012 (TFS) is the collaboration platform at the core of Microsoft's application lifecycle management (ALM) solution. TFS supports agile development practices, multiple IDEs and platforms locally or in the cloud and gives you the tools you need to effectively manage software development projects throughout the IT lifecycle.

What's New with TFS


    TFS 2012 Power Tools are now available!

    Download from here Team Foundations Server 2012 Power Tools
     A few reminders about how Power Tools work and comments on this release…
  1. You can go to the Visual Studio Gallery page listed above to get a summary of what’s in the Power Tools.
  2. All the Power Tools were updated to work with a TFS 2012 server.
  3. The TFS 2012 Power Tools that are Visual Studio add-ins only work with VS 2012.  If you want add-ins for Visual Studio 2010, use the TFS 2010 Power Tools – most of them still work against a 2012 server (a caveat or two below).
  4. Most of the TFS 2012 client Power Tools work with a TFS 2010 or TFS 2008 server (again, a caveat or two below).
  5. The TFS 2010 and TFS 2012 Power Tools can be installed SxS if you use both IDEs.
  6. The Team Members Power Tool was changed radically in this release.  It was modified to take advantage of new TFS 2012 features.  As such it is incompatible with TFS 2010 and earlier and does not run off the same team member definition data as the TFS 2010 Team Members Power Tool, making using the VS 2010 IDE and VS 2012 IDE together with the Team Members Power Tool a bit of a pain (double administration).
For the most part, this Power Tools release is just a port of the existing TFS 2010 Power Tools to TFS 2012 and VS 2012 (along with a bunch of bug fixes).  However, there are a few notable changes.

Storyboard Shapes Power Tool

We added a tool for creating dynamically sizeable storyboard shapes to the Power Tools.  It’s not pretty (it’s a command line tool) but it’s effective – we used it to create all the shapes we’ve released.  This tool was previously released separately on the gallery but we’ve included it in the Power Tools to make it easier to get.

Team Members

As I mentioned above, we radically revamped Team Members.  We did so in two dimensions.  The client was redone to take advantage of the new rich expressive capabilities of Team Explorer.  We also took advantage of new server extensibility features to better integrate with TFS’s groups and identities system rather than the semi goofy model of checked in XML files describing your team information.  The penalty for this is that it’s incompatible with previous TFS versions.  It was a painful call but we decided we wanted to get on the right infrastructure so we could more easily manage it and innovate on it going forward.
clip_image001
clip_image001[5]

Agile Process Settings

We added the ability to edit the Agile Project Management (think taskboard) settings with the process template editor.  For now it’s pretty primitive because all it let’s you do is edit the XML but we expect to replace this with a nice interface for doing it in the future.
clip_image001[7]

Removed Power Tools

Every Power Tools release I’m asked how come “X” is still a Power Tool?  Why didn’t it make it into the product.  Every release, our goal is to take a portion of the Power Tools and integrate them into the product.  I make no promises about when or if every Power Tool will make it into the product, but I promise to try to make progress by integrating some of the most popular ones every release.  Here’s the Power Tools that have been removed because they have been incorporated into the product.
Work item alerts – We added the power of the work item alerts Power Tool to Team Web Access in TFS 2012.  The downside of this approach is that if you are using VS 2012 along with a TFS 2010 server, you won’t have this capability (because it’s on the server in 2012).  You would need to use a TFS 2010 IDE + Power Tools to have this ability.
Comments checkin policy – The comments checkin policy is now in VS 2012.
Rollback – Rollback has been in the product since 2010 but we only had command-line support.  We added GUI support as a Power Tool for VS 2010 and now it’s been added in the VS 2012 product so we removed the Power Tool.
Work item search – The TFS 2010 Power Tools introduced a super simple full text work item search solution.  That’s now been added to Team Explorer in TFS 2012 so it’s been removed from the Power Tools.