Wednesday 12 March 2008

Tips for upgrading TFS 2005 to TFS 2008

I found this site to be very useful. I followed the instructions and they were pretty much on the money. I had a couple of minor issues - mostly to do with domain changes so beyond the scope of Grant's instructions.

So success in upgrading to TFS 2008 and WSS 3.0 - and was relatively painless aswell.

The main things I would recommend when doing this are :

1. Test the disaster recover - an upgrade is as good an excuse as any (use a standby server).
2. Trial run the upgrade on a copy standby server.
3. Take a disk image of your server before you start - that way if it all goes v.bad you can recover easily.
4. Be prepared for things to go wrong - the pre scans and best practices are fairly strict.
5. Change the Share Point Administration shortcut in admin tools to point to the new port.

Upgrade TFS 2005 WSS2.0 to TFS 2008 WSS3.0

Stolen from here are the steps to upgrade WSS2.0 to WSS3.0 when upgrading TFS 2005 to TFS 2008. Worked well for me!


Run Orcas TFS installer to upgrade your VS2005 TFS server. At end of this process you should have Orcas server with WSS2.0 configured.

Next Run WSS prescan.exe tool to verify if you can upgrade WSS from 2.0 to 3.0

Run WSS3.0 Installer and select the upgrade option

The installer will ask you for new Administration Port. You cannot use the old port(17012). You need to select new port number.

Complete all the installation and upgrade steps for WSS3.0

Now you should have Orcas server with WSS3.0. You still cannot use the system as you still need to tell TFS about the new URLs for WSS and also upload the new site templates for WSS3.0

Run Share Point Extensions for TFS setup. This should be located at InstallMedia\WssExt directory. This will upload the new site templates for WSS3.0.
The upgrade changes the WSS admin site URL. To make this change in TFS you can use TFSAdminUtil . Following is the command you can use.

TFSAdminUtil configureconnections /SharepointAdminUri:http://wssserver:adminport

Note: You can use TFSAdminUtil to update all the different URL's for WSS. Following is the syntax for updating all WSS related attributes in TFS.

TFSAdminUtil configureconnections
/SharepointURI:http://wssserver:80
/SharepointSitesUri:http://wssserver:80/sites
/SharepointAdminUri:http://wssserver:adminport
/SharepointUnc:\\wssserver\sites


Finally - make sure you change the shortcut to SharePoint Central Administration in the Administration Tools to point to the new port !!

I had a problem with the Central Administration reporting Service Unavailable.
This was due to an incorrect login in the application pool (IIS - Sharepoint Central Administration v3), which was fairly easy to find.

Excel interop with C# memory leak - Sheet.Rows.Count and Sheet.Columns.Count

Investigations of the horrendous memory leak in my Office 2007 Ribbon application led me (by trial and error tbh) to an issue with the Interop Sheet.Rows.Count. I was using this - naively - to count the number of rows on a particular sheet, and was then using that figure to create a range which I cleared.

The only problem is that Sheet.Rows.Count and Sheet.Columns.Count return the maximum possible Rows/Columns on a sheet even if they are not populated with data. This is not what I wanted to do. I wanted to know the dimensions of the populated area so that I could blank it.

Coupled to this is that Range.Clear() seems to retain memory for a long period of time - this may be due however to the size of the range created by the eroneous returns of Sheet.Rows.Count/Sheet.Columns.Count.

I am now in the process of finding a different way to do this, and may have a possible solution. I will post it up when I have confirmed it.

Tuesday 11 March 2008

.NET Memory Usage

Had an issue with a user complaining that Excel uses too much memory in task manager, so I investigated what the usage really is.

The first point to note is that Task Manager does not accurately report the memory used by an application. It shows the Working Set - that is memory that has been "reserved" by Windows just in case. If another application needs the memory then it is re-allocated. As such we really need to measure memory usage using Performance Manager.

The main counters to add are from the Process object. Make sure you select your .NET application, and add the counters Private Bytes and Working Set. Private Bytes gives the true (ish) figure - however bear in mind that this may be swapped to disk so will not necessarily have an impact on your system.

The article that explains this further can be found here.

Monday 10 March 2008

Custom Report Items in SSRS 2005

I was recommended the following by Jon as a possible solution to a calendar painting issue that Owen has. SSRS can be extended using custom report items (CRI) which should allow us to do jsut about anything. Jazz Up Your Data Using Custom Report Items In SQL Server Reporting Services runs through an example of this and is worth a look.

Friday 7 March 2008

Diagnosing Replication Issues

I'm in the process of creating a Transaction Replication solution that incorporates some transformation. The condensed version is that the publisher data structure is nothing like the subscriber structure. To do this I have replaced the standard sp_MSins/del/upd stored procedures with my own coding. There is some simple transformation going on in these sp's, and debugging it is not nice.

So, imagine my delight when an article from SqlServerCentral dropped into my Inbox - couldn't have been better time.

The important bit for me was establishing where the problem lies and what to do with it. The way to do this is as follows:

In Replication Monitor examine the error message in the detail screen. It will have something like this :

Command attempted:
if @@trancount > 0 rollback tran
(Transaction sequence number: 0x0000018F0000008800A700000000, Command ID: 83)

Error messages:
etc.

The bit to note is the Transaction sequence number and Command ID. You can drop the trailing 0's from the sequence number.

Next SELECT FROM msdistribution_agents and get the publisher_database_id. Note this number, you'll need it.

Finally, call the procedure sp_browsereplcmds :

exec sp_browsereplcmds
@xact_seqno_start = '0x0000018F0000008800A7',
@xact_seqno_end = '0x0000018F0000008800A7',
@publisher_database_id = 15,
@command_id = 83

Examine the contents of the command column - this is what is being sent to your stored procedure. You can now run this by hand and see what the issue is. I recommend using a transaction and rolling back so that you do not introduce other errors.