Monday, November 26, 2007

Migrating InfoPath forms over to MOSS

Last week I had a customer that used InfoPath extensively for basic data capture. The forms themselves were quite basic. Most had a couple of data connections to SharePoint lists (for drop-down values), as well as the main Submit data connection. Modifying each of these forms involved migrating each of the lookup lists to the new SharePoint environment, creating the destination Forms Library to hold the submitted forms, modifying each of the data connections in InfoPath to point to these lists and libraries, and finally Publishing the form to the new location.


Of bigger concern was the fact that there were hundreds (if not thousands) of data files (i.e. .xml files containing submitted data). As you may or may not know, submitted InfoPath documents have a processing instruction at the top of the XML, which tells Windows that it is an InfoPath document, as well as where to get the InfoPath XSN template to load.


Fortunately, MOSS form libraries now have a new default view called 'Relink Documents'. By using this view, you can select each of the existing documents and relink them to the new template. Below is a screenshot:


Discovered a new issue with SharePoint 2007 stsadm Export function

Last week I had to move some team sites from an upgraded site into a new MOSS site structure. Normally when using the stsadm export function I use the following syntax, which ensures that I move across all document versions, as well as maintain document 'modified by' type information.

stsadm -o export -url http://moss_site/sites/projects/it_projects -filename it_projects.dat -includeusersecurity -versions 4

But this kept on failing for this particular site. On closer inspection of the export log I discovered that one document in the document library had 151 versions!! It was this document that was causing all of the problems.

My solution was to just move across the latest version of the document instead, which has the syntax:

stsadm -o export -url http://moss_site/sites/projects/it_projects -filename it_projects.dat -includeusersecurity -versions 2

Looking back on it now, I could have also tried to delete previous versions, but this could have been a trial and error thing (because I don't know what the export limit actually is - 50 versions? 100 versions? Who knows?)

Thursday, October 25, 2007

Implications of WSS/SPS 2003 sp3

Although most of the time I am working on MOSS related projects, one of my clients still requires my support with SPS 2003. They had rebuilt the environment to be SPS sp2 on Windows Server 2003 service pack 2. If you didn't already know, this combination breaks the 'Create Site' functionality (it hangs on the Add Link to Site section). Anyway, last week I installed WSS/SPS service pack 3, which fortunately fixed this problem. However, today I discovered that the Rich Text Editor within the Content Editor Web Part no longer works. To fix this, you have to modify both ows.js and htmledit.aspx to include an additional JavaScript function called RenderActiveX. This function accepts a string, then just does a document.write(str) with it. Simple fix really, but it should have been tested more thoroughly before it was released.

Monday, August 13, 2007

Huge week at TechEd!

Well it was a massive week on the Gold Coast. The highlights for me were:
  • Getting 100% on the MOSS configuration exam after only 2 hours of study at 5.30 in the morning.
  • The Superman ride at Movie World
  • Winning the Grand Prize!!!!

I am still not entirely sure what I have won (they are shipping it to me this week). But I did see a new Palm phone in the the basket of goodies. Apparently it is supposed to be worth $20K - I hope it is not all t-shirts and caps!

Tuesday, July 31, 2007

Export/Import traps for young players

Often when you are upgrading or migrating content to a new MOSS site, you will inevitably use the 'STSADM -o export' and 'STSADM -o import' commands. One of the 'traps' when using the export command is if the site you are exporting contains subsites, if you do not have access to that subsite (i.e. the subsite has not inherited permissions from its parent), then the subsite will not be exported (and hence will not exist after the import).

The other thing to be wary of is the use of the -includeusersecurity switch. If you do not use this switch in the export, and then again in the import, all content within the imported site will list you as the author. The downside in using this switch however is that all of the old security settings that existed in the exported site (e.g. WSS v2 Site Groups), will exist in the imported site, so you will need to do a cleanup afterwards.

Two steps forward - one step back

There is no doubting that MOSS contains a bunch of new features that people find useful. But sometimes it astounds me that minor oversights have made it into the product. My biggest bug-bears include:
  1. When you navigate to a document library that has folders, you will see that the navigation breadcrumb is updated, thus allowing you to move around quickly in the document library(which is good). But drop that document library onto say the landing page, then the only way to navigate around the document library is to use the browser's back button. In WSS v2/SPS 2003, the web part automatically included an up link. So many of my clients have asked 'where has the up arrow gone?'.
  2. Events Calendar - hmmmm...where to start? OK, first of all there is no way to resize the control. So many team sites today include some sort of shared calendar. Dropping the web part onto the page (say in a standard two column layout), pushes the page out to the right, so people have to scroll. The only way that I have gotten around this is to purchase a third party web part like Kwizcom.
  3. Events Calendar again. There is no way to get a reliable 'What's on today?' view. First of all, the Start Time is not available in the Filter section within the view administration. The only way that I have gotten around this is to create a calculated field (e.g. Begin Time) that is equal to [Start Time] + 0.1, then create the view based on that calculated field. The 0.1 addition is required to cater for all day events. Without that, the event usually appears in the day before. But then comes the real problem - recurring events do not show up. This is because the Start Time field is based on when the recurring event should be effective from, not the actual start time of the event. The only way to get these events showing up (and you will love this one) is by editing each recurring event EVERY day, so that the Start Time changes to today (and hence shows up).

Let's home that either third party web parts fill these gaps, or a Microsoft patch fixes it.

Sunday, July 29, 2007

I've Been Busy

Sorry I haven't posted for a while. Since May I have been flat out working on MOSS projects, which hasn't left much time for writing. I will pick up my game again after TechEd (next week).

Thursday, May 24, 2007

Problem with News Redirector in MOSS

The redirector function within MOSS 2007 works fine if you are redirecting to a web page (for both normal read-only users and administrators), but when the redirect is pointing to a document (e.g. .doc or .pdf), then normal read-only users get the following:


Looking at the MOSS logs, we see the following:

04/29/2007 08:20:25.27 w3wp.exe (0x013C) 0x09F8 CMS Publishing 7fov Medium Caught a thread abort exception in TemplateRedirectionPage.ProcessRequest, the exception may be expected. stack trace= at Microsoft.SharePoint.Utilities.SPUtility.Redirect(String url, SPRedirectFlags flags, HttpContext context, String queryString) at Microsoft.SharePoint.Utilities.SPUtility.Redirect(String url, SPRedirectFlags flags, HttpContext context) at Microsoft.SharePoint.Publishing.WebControls.RedirectControl.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at Sys...
04/29/2007 08:20:25.27* w3wp.exe (0x013C) 0x09F8 CMS Publishing 7fov Medium ...tem.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) at System.Web.UI.Page.ProcessRequest() at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) at System.Web.UI.Page.ProcessRequest(HttpContext context) at ASP.REDIRECTPAGELAYOUT_ASPX__855614915.ProcessRequest(HttpContext context) at Microsoft.SharePoint.Publishing.TemplateRedirectionPage.ProcessRequest(HttpContext context)



When an administrator tries the same page, they see the page:


Then they are redirected to (in this case) a Word document.

NOTE: This is not a permissions issue to the document (i.e. the user can open the document directly).

Work Around
The only work-around is to change the 'Pages' library security settings (where the redirect page resides). For this, you will need to break the security inheritance from the parent News site. You must set all readers to have contributor access. To prevent malicious updates to the news articles, you simply configure the Pages library to require content approval, then setup an approval workflow to notify the administrator of the news area.

.NET 3.0 Install Issues

I came across an issue today at a client site that was heavily locked down. Basically I could not get to any other web site except the windows update site using IE. This meant that when I ran dotnetfx3setup.exe (which installs just a stub then tries to download 33MB of data from the web), it fails because it cannot access the Internet. I got around this by using the Windows Update site. Using IE, navigate to Tools Windows Update. When the screen appears, select Custom. The .NET 3.0 software is listed as one of the optional components. Pretty simple fix, but when first faced with this type of issue, it seems like a show stopper.

Saturday, May 12, 2007

MS-Advantage's SPS to MOSS 2007 Upgrade Tips (Database Migration)

Over the last few months I have been doing quite a lot with upgrades. I got frustrated recently with Microsoft presentations stating that the database migration approach contained many manual steps (with no one from Microsoft actually willing to state what those steps were). Even the upgrade documentation says 'Repeat the restore and add database procedures for all content, search, and user profile databases'. They make it seem so simple don't they? I had previously found that I could upgrade the site content, but not the profile/audience information. No matter what I did, the upgrade resulted in me bashing my head up against a wall. Well in the week off between finishing up with SDM and starting a contract with DiData, I spent a lot of hours actually getting this to work. The information below has taken a lot of blood, sweat and tears. So rather than you 'claiming it as your own', I would appreciate it if you at least give me some credit. My company (MS-Advantage Pty Ltd) is always keen to provide additional consulting services if required :-)

My tips for upgrading:
  1. Get your preconfig running early in the piece, so that you leave yourself time to cleanup orphaned objects or unused sites. The PREUPGRADESCANCONFIG.xml file should contain each definition of your custom templates. Document the unghosted pages. In most instances, you would want to Reset to Site Definition after the upgrade (otherwise you cannot take advantage of the features available in MOSS).
  2. Run SharePoint Configuration Analyzer, making sure you package up all of the web part cab files. Create a batch file for later installation of these web parts. The Configuration Analyzer is also useful in identifying closed web parts on pages (which should typically be deleted).
  3. Sort out your Account naming conventions and database naming conventions before the upgrade. For databases, I often prefix the farm name and suffix the host header. E.g. IntPrd_WSS_CONTENT_Intranet.
  4. Decide on whether or not you are going to configure sites with Kerberos or not. Make sure you have knowledgeable infrastructure people who know how to use the SetSpn command and to troubleshoot kerberos related issues. I find that IE 7 in particular continually re-prompts for authentication if kerberos is not setup properly (whereas IE6 seems to revert to NTLM mode).
  5. I prefer to do a database migration rather than an in-place upgrade or gradual upgrade. With in-place upgrade often it is difficult to clean up the old SPS installation properly (you need to stop all of the SPS services before attempting to uninstall). With the gradual upgrade, I find the documentation doesn't really cover best practices for migrating sites across (e.g. do you use stsadm -o backup, then stsadm -o restore; or do you use the export/import approach - I haven't tried the export on a SPS machine).
  6. Make sure that you create all of your MOSS-based custom site definitions and that they are in place before you run the upgrade. I typically just copy the OOB ones and rename them based on which template most closely matches your custom template (90% of SPS implementations just change SPSTOPIC, SPSNEWS etc because of branding/integration of navigation web parts, rather than fundamental changes to list definitions etc). If you have previously used custom templates, copy across your own webtemp??.xml file with your custom site definitions in there.
  7. In the 12\Config\Upgrade directory, you must create your own SPSUpgrade.xml file (I typically use SPSUpgrade.xml). This file maps tells the upgrade process what to do with references to custom templates that it finds in the content.
  8. Also in the 12\Config\Upgrade directory, if you have custom templates, you need to update the SiteUpgraderConfigSPS.xml file. This file typically tells the upgrade process what layout page to use with each associated template. By default, the SPS template will use the defaultLayout.aspx page, which has a different zone layout to the previous version (3 zone columns). I often find that when migrating from the SPS 2 zone structure to the 3 zone structure, the resultant upgraded page can become wider that it was previously, thus causing people with 1024x768 resolutions to scroll. To combat this, I have previously changed the mapping for the SPS template to use the welcomeLayout2.aspx page instead of the defaultLayout.aspx, as this page has the same 2 zone structure that was used in SPS 2003. All of the other custom site definitions typically use the welcomeLayout2.aspx page also.
  9. After creating the farm, configure base services (email, Office SharePoint Search, WSS Search). At this point you do not have any MOSS sites or SSP sites.
  10. At this point, do a final prescan on the SPS box and do a backup of the databases (for the migration). To prevent users from possibly changing the current SPS environment, set it to read only (I typically do this via Central Administration Configure site quotas and locks from the Virtual Server List page Manage site collection quotas and locks, then select the 'Adding content prevented' radio button.
  11. Switch back to the MOSS environment and create the MOSS web application. Specify a dummy database name. I usually give it a host header also. E.g. devintranet.
  12. Restore the _SITE, _PROF and _SERV databases (I typically restore these with different names to match the new MOSS database naming convention. The _PROF becomes the _DB database and the _SERV becomes the _SEARCH_DB database). Set the database security on the _SITE database to match the security that has been applied to the dummy database you created (farm account should have db_owner access to the database). The server farm account should have db_owner access to the restored _DB and _SEARCH_DB databases.
  13. To upgrade the content database, I recommend doing it from the command line (web interface may timeout if the database is large). First, detach the dummy database from the MOSS web application. Do this with the command "stsadm –o deletecontentdb –url http://devintranet –databasename IntDev_DUMMYDB_DevIntranet". Then attach (and upgrade) the restored _SITE database with the command "stsadm –o addcontentdb –url http://devintranet –databasename IntDev_WSS_CONTENT_DevIntranet"
  14. THIS PART IS CRITICAL - Create the new mysite host with the command stsadm -o createweb -url http://devintranet/userprofile -sitetemplate SPSMSITEHOST -title "MySite Host" (I use the syntax 'userprofile' as this is used in the URL when displaying people's public my sites. Private my sites will remain as /personal/...)
  15. Run the previously created batch file (from SCA) to install each of the web parts.
  16. Create the SSP web application (just through 'Create or extend web application'). I typically set this up with port 11000 and give it a host header name. E.g. intdevssp1.
  17. THIS PART IS CRITICAL - You need to perform a restore of the SSP site to capture and upgrade the profile/audience information. This must be done from the command line. The syntax is "stsadm -o restoressp -title SharedServices1 -url http://intdevssp1:11000 -ssplogin "domain\svc-spsspintdevssp1" -mysiteurl http://devintranet/userprofile -indexserver myindexservername -indexlocation "E:\Program Files\Microsoft Office Servers\12.0\Data\Office Server\Applications" -sspdatabaseserver mydbserver -sspdatabasename IntDev_IntDevSSP1_DB -ssppassword “myssppassword” -searchdatabaseserver mydbserver -searchdatabasename IntDev_IntDevSSP1_Search_DB -ssl no
    A warning message usually appears with the message “Could not find stored procedure 'dbo.proc_MSS_PropagationGetQueryServers'”. I have not worked this out as yet, but the upgrade appears to have worked successfully at this point.
  18. Within Central Admin, apply a web application policy for a 'MOSS Admins' group (I typically do this because you can only specify an individual for site collection administrators).
  19. By default, the account used to setup the farm will have access to the Shared Services Provider site when it is created. Although adding the MOSS Administrators group to the web application policy gives those users the right to access the site, certain activities such as modifying the user profile schema is still secured. To fix this problem, login to the SSP site using the administrator account that created the farm. Select the 'Personalization services permissions' hyperlink in the SSP site and add the MOSS Admins group. Give the MOSS Admins group full access (i.e. 'Create personal site', 'Use personal features', 'Manage user profiles', 'Manage audiences', 'Manage permissions' and 'Manage usage analytics' rights).
  20. After an upgrade, you may notice a synchronisation issue being logged in the Windows Event Log. To fix this, from the command prompt, type:
    Stsadm –o sync –DeleteOldDatabases 0
  21. There is a known bug with upgrades and that is that new users get an error when trying to create their my site. To fix this issue, navigate to Central Administration Application Management, and enable self service site creation. Add the application pool account associated with the my site host to the local administrators group. Perform an IIS reset.
  22. TIP. I often find that previously in SPS/WSS, business units had to move their collaborative content into a team site (because of the more granular security). I have found that many customers often want to put these two previously segregated components back together (e.g. have one HR site that contains both published information and collaborative workspaces). To do this, you must use the stsadm -export and -import commands. I have found that if you use the minimal amount of arguments to these commands, documents for instance sometimes don't get exported (and are therefore subsequently missing following the import). The most reliable syntax I have found for the export is "stsadm -o export -url http://devintranet/sites/hr -filename hr.bak -includeusersecurity -versions 4". For the import, the most reliable syntax is "stsadm -o import -url "http://devintranet/Departments/Corporate Services/HR" -filename hr.bak -includeusersecurity -updateversions 2"
  23. TIP. The upgrade process tries to fix and remap every bucket web instance that it finds (i.e. C1, C2 etc). Often however, if you have hardcoded links in content, these will not be detected by the upgrade. To address this, configure the search engine (i.e. do a full index crawl), then do searches for 'C1', 'C2' etc to find these hard-coded links.

I hope these tips/instructions save you the pain that I went through.

South East Water Goes Live

When I left SDM a few weeks ago, I had just finished developing South East Water's public web site using MOSS (only content needed to be added). Even after I had finished SDM, I was still testing it remotely and providing feedback (we had a wierd deployment issue, which was resolved with the help of Angus Logan). Well it finally went live this week. Check it out at www.sewl.com.au. Thanks to William Cornwill (CodeJedi) who also worked with me on this project.

Friday, April 27, 2007

Shared Service Provider Access Denied

As I have had plenty of time playing with MOSS installs/upgrades over the last week (in between jobs), I discovered an interesting behaviour with Shared Service providers. I tried to simulate a proper production install, so I installed MOSS and configured the farm with a test administrator account (e.g. testadmin). During the upgrade process (database migration of the _PROF, _SERV and _SITE db) I logged on as a different administrator (not a domain admin, but a local admin on the box). Well the upgrade went through without a problem and I was able to restore the SSP. I then added myself to have full control over the dev intranet site and the SSP site (using Policy for Web Application). I then navigated to the SSP site and configured the search. Then I went to update the profile information and it was there that I got the old Access Denied, you must sign in as someone else. After scratching my head for a while, I discovered the 'Personalization services permissions' hyperlink in the SSP site. So I logged back in as testadmin (who at this time was the only user who could actually get to the profile settings page), invoked this function and added a new group to the list, giving them 'Create personal site', 'Use personal features', 'Manage user profiles', 'Manage audiences', 'Manage permissions' and 'Manage usage analytics' rights, and low and behold I was able to edit profile settings with my normal local administrator account.

Tuesday, April 17, 2007

My last week at SDM

Well it was a tough decision, but I have decided to leave SDM and start my own business (MS-Advantage Pty Ltd). I start a 9 month contract with DiData on Monday the 30th of April.

It will be sad to go, but I am looking forward to the challenges ahead. SDM is a great company to work for with some very talented people.

Update on SharePoint ASPMenu control

It ended up being caused by a custom developed breadbrumb control that was requiring extra credentials in order to query the parent site title. We ended up having to remove the control.

Wednesday, April 04, 2007

SharePoint ASPMenu control is prompting for user credentials if it finds draft documents on the public site

I am working on an MOSS internet project at the moment, and today I came across a strange behaviour in development where users get prompted for their credentials.

Background
Basically I setup a staging environment and did a full deployment through an ISA firewall to a destination server. I then setup anon security on the destination site. After making some changes to pages in development, I then ran a deployment to copy across changed files since the last deployment. One of the things I noticed (and I wasn't aware of this) was that during a content deployment, it is not only the published files that get deployed, but also Draft pages. It doesn't seem to matter whether it is a full deployment or only the deployment of changes - draft content still gets sent across (which is bad).

Now I have a couple of Master pages, each of which contains 3 content placeholder ids (PlaceHolderLeftNavBar, PlaceHolderMain, PlaceHolderAdSpace). The page layout used only overwrites the PlaceHolderMain and PlaceHolderAdSpace regions (i.e. no reference to PlaceHolderLeftNavBar at all). In this case, my main master page outputs the ASPMenu control in the PlaceHolderLeftNavBar space. My other master page contains the 3 content placeholders, but does not put anything into the PlaceHolderLeftNavBar area (and as the page layout doesn't reference this id also, nothing gets rendered in the left nav area).

The Experienced Problem
On the destination server, when the master page with the ASPMenu left nav gets used, if there is any draft pages that it finds, it prompts for credentials, instead of just hiding them. If I switch master pages so that the ASPMenu is no longer rendered on the page, the user does not get prompted.

If anyone knows why this is and knows how to fix it, please post a comment.

Monday, April 02, 2007

Microsoft ForeFront may cause WCM deployment to fail

Today at a client site I noticed that content deployment just stopped working from my staging environment to the live site. Basically the job said that it failed, but gave no errors or warnings at the staging environment end. So I started to investigate what was going on within the destination server. The event log had the following error:

Failed import operation for Content Deployment job 'Remote import job for job with sourceID = f483830c-116d-4fd1-9d68-5dc6df9bd2cf'. Exception was: 'Microsoft.SharePoint.SPException: Exception from HRESULT: 0x81070000 ---> System.Runtime.InteropServices.COMException (0x81070000): Exception from HRESULT: 0x81070000
at Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish)
at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish)
--- End of inner exception stack trace ---
at Microsoft.SharePoint.Library.SPRequest.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish)
at Microsoft.SharePoint.SPListItem.AddOrUpdateItem(Boolean bAdd, Boolean bSystem, Boolean bPreserveItemVersion, Boolean bNoVersion, Boolean bMigration, Boolean bPublish, Boolean bCheckOut, Boolean bCheckin, Guid newGuidOnAdd, Int32& ulID, Object& objAttachmentNames, Object& objAttachmentContents, Boolean suppressAfterEvents)
at Microsoft.SharePoint.SPListItem.UpdateInternal(Boolean bSystem, Boolean bPreserveItemVersion, Guid newGuidOnAdd, Boolean bMigration, Boolean bPublish, Boolean bNoVersion, Boolean bCheckOut, Boolean bCheckin, Boolean suppressAfterEvents)
at Microsoft.SharePoint.SPListItem.Update()
at Microsoft.SharePoint.SPAttachmentCollection.AddNow(String leafName, Byte[] data)
at Microsoft.SharePoint.Publishing.Administration.JobReportBase.Update()
at Microsoft.SharePoint.Publishing.Administration.ContentDeploymentJob.importexport_Error(Object sender, SPDeploymentErrorEventArgs errorEventArg)
at Microsoft.SharePoint.Deployment.SPDeployment.OnError(SPDeploymentErrorEventArgs e)
at Microsoft.SharePoint.Deployment.DeploymentLogger.Log(DeploymentLogSeverity severity, SPDeploymentObject deplObject, String message, Boolean throwException)
at Microsoft.SharePoint.Deployment.DeploymentLogger.Log(DeploymentLogSeverity severity, SPDeploymentObject deplObject, Exception exception, Boolean throwNewException)
at Microsoft.SharePoint.Deployment.DeploymentLogger.Log(DeploymentLogSeverity severity, Exception exception, Boolean throwNewException)
at Microsoft.SharePoint.Deployment.SPImport.Run()
at Microsoft.SharePoint.Publishing.Administration.ContentDeploymentJob.DoImport()'

This would be a tricky one to fix...
So I dug deeper into the event log and noticed that a couple of days before, when there were no errors, this service called GetEngineFiles (i.e. ForeFront) had been started. The service was having numerous problems accessing the internet to updated its various scanning engines (because it was a dev machine, and external web access was blocked by the proxy). So I walked over to the infrastructure guys and politely asked 'What the F@#% have you been doing with my server?'. To this they responded 'oh, we installed Microsoft Forefront on it a couple of days ago and configured SharePoint to integrate with it'. So I again politely asked for them to uninstall it and reboot the machine. After this, miracles of miracles, the WCM deployment started working again.
There endith the lesson - Without communication, we would all be lost!

Monday, March 19, 2007

Simple way to apply colour schemes across your site

You could use themes, but an easier way is to create separate stylesheets that override base styles that you have created (with different colour schemes). Then within each top level site that you want to apply the colour scheme to, navigate to Site Settings | Master page, and in the alternate CSS URL section, select the 'Specify a CSS file to be used by this publishing site and all sites that inherit from it' radio button and then specify the path to your alternate CSS file. Pretty straight forward really. :-)

Web Design Tools that I can no longer live without

One of the biggest pains when building a new web site on MOSS is cross browser development and testing. Often, slight errors in stylesheets can have disasterous affects on different browsers. One of the tools that I have found help me in this regard is the FireBug add-in within Firefox. This tool lets you inspect a particular element on the page. It then tells you where it is picking up the associated styles for the selected element. It references each stylesheet name that has been included, the line number, and which CSS attributes are being ignored. It really helps you to quickly identify bizaar behaviours within a page.

Wednesday, March 07, 2007

MOSS 2007 - Web Part Pages don't display the left navigation

I discovered this on my current project. Bizaar - web part pages never render the left navigation. This looks crap, because you flick from publishing pages that display the left nav to web part pages that don't.

I hunted around to find a fix and here it is...
The Master page contains the following two Content Placeholders, which are instructed by the web part pages not to load.

<asp:contentplaceholder id="PlaceHolderLeftNavBar" runat="server"> "CODE" </asp:ContentPlaceHolder>

<asp:contentplaceholder id="PlaceHolderNavSpacer" runat="server">"CODE"</asp:ContentPlaceholder>

Basically within these two content placeholders you move each 'CODE' block outside each ContentPlaceHolder tag.

NOTE:DO NOT delete the Content Placeholders, as they are still needed to render (load) the page. The page will error if they are deleted.

Monday, March 05, 2007

An update on the Timed Out Deployment Job

Even though the job said that it had timed out, refreshing the page showed that it was successful, but with the error 'Content deployment job Full Deployment: Timed Out'. Clicking on this error shows the message 'The connection to the destination server was lost after the remote import job was started. The import job might still succeed. Content deployment will continue to attempt to reestablish a connection with the destination server.'

It would be good to have a repeatable, consistently successful deployment. Angus Logan from Microsoft suggested to change the timezone on the server to 1 hour prior, but that doesn't seem to have fixed the timeout problem.

MOSS 2007 - No Results renders differently in People scope

Within MOSS, there are two different web part instances to display the search results between the 'All Sites' tab and the 'People' tab. When you are on the all items tab, it is called the 'Search Core Results' web part, whereas in the People tab it is called the People Search Core Results web part. For some strange reason, the XSL for rendering the No Search results is different in these two pages. The core search page uses a span tag with a class of 'srch-description', whereas in the people search, it uses a span tag with a class of 'ms-sbplain'. The ms-sbplain style often has a border around it because this style is used for the standard search entry input screen. Therefore the People search No Results message has borders around every peace of text that it renders. To fix the problem, switch to the People tag and edit the page. Edit the XSL associated with the People Search Core Results web part and replace the ms-sbplain style in the No Results section to srch-description.

Friday, March 02, 2007

First Real WCM Not so successful

Well it repeated the same error I had on my VPC environment - timed out.
"The connection to the destination server was lost after the remote import job was started. The import job might still succeed. Content deployment will continue to attempt to reestablish a connection with the destination server".

The export worked (i.e. it exported over 1800 pieces of content), but the import failed. Bugger!

My first real WCM Deployment

Today at a client site I was testing the deployment of a WCM site across to an external DMZ network. I had setup a blank site collection on the destination server, SSP etc, configured the Central Administration to accept deployment requests, then switched back to the development server to start the deployment. The next 2 hours would be painful...
When trying to setup the deployment path, it kept failing connecting to the destination Central Administration site. With the help of a local infrastructure guru we went into troubleshooting mode. There was no proxy configured and the web.config file of each site on the server was configured to not detect for one, yet on the firewall trace we could see that the server was communicating with the Proxy as an anonymous user. We could have allowed anonymous access on the proxy to fix the problem (which we did initially, but this is not the preferred approach), but their had to be a better way. We went off on tangents for a while, checking the registry against each of the system accounts to see if their settings were configured to use a proxy or to auto detect (which they weren't). We couldn't find where this 'Autodetect' IE setting was coming from (i.e. why was it going to the proxy).

Before I go into spelling out how we fixed it, here's a little lesson that I learnt from my infrastructure friend. Whenever a server looks for a server, it accesses a record called 'wpad' within the DNS. The wpad tells the client where to go find the server. The default setting was the proxy server (i.e. the ISA Server). The client then communicates with this server (i.e. the ISA Server) for a configuration file, which tells it which domains it can try to talk directly with and which ones have to go via the proxy. In our case, this config file was telling the client that every request must go through the proxy.

To fix the problem we modified ISA's automatic detections script. We added the external domains to the domain include list, which essentially tells it that a client request can try to talk to the remote server directly. We then modified the firewall rules (not ISA in this case) to allow communication from the specific source MOSS Server to the destination MOSS server on the nominated central administration port.

This fixed the communication problem immediately.

Next Steps - I configured the Quick Deploy settings to allow quick deployments to occur, then created another job for a full deployment. After trying to start the quick deploy and let it sit there for a while on the 'Preparing' status (I don't know whether this is a problem because of the OWSTimer bug working on UTC time and not GMT time), I cancelled the job. Funny thing was, shortly after this, the status changed to Running and then eventually to Failed.
I've now kicked off the full deployment, but at the moment it is still in the 'Preparing' state. I will keep you posted on whether or not this works (BTW, I have yet to get deployment to work on a VPC environment, where the source and destination sites are on the same server (and SQL is on the same Server too). The error I usually get is a timeout error. It would be good if Microsoft could provide some more technical notes about what is happening under the covers when a deployment occurs. There is some coding samples, but if the underlying plumbing is not working, whats the point.

Monday, February 26, 2007

MOSS 2007 - Import/Export Lessons Learnt

On my current project, we are required to use the stsadm export/import switch to move team sites to their new information architecture ('/sites/sitex' type syntax is not really required any more if you are happy for the sites to belong to the top level site collection). In addition to this, we wanted to migrate a site from another MOSS box to the new site. Once again we tried the export/import, but it didn't work.

Closer inspection revealed that although the export appeared to work (i.e. we got a success message), closer scrutiny of the export log shows that not all objects were correctly exported (in our case, some of the list definitions). This was due to the account that we were logged in as. We did not have read-write access to the database. Logging on as a local administrator with full privilege to the database resolved this problem.

The second problem we had was to do with migrating subsites (not site collections). We found that you can only import them to a top sub level site – and only if you first create a blank sub site with the same name first. This is the opposite when importing site collections – you can import them without first having to create a blank site, and you can import them anywhere in the site (not just straight under the top level site collection).

So once you’ve got the thing successfully imported at a top sub site level, you can easily move them around using the 'Manage Content and Structure' GUI interface.

FYI, the syntax for an export is:
stsadm -o export -url http://myserver/mysubsite1/mysubsite2 -filename c:\backup.dat -overwrite
the syntax for an an import is:
stsadm -o import -url http://mynewserver/mysubsite2 -filename c:\backup.dat

Thursday, February 22, 2007

MOSS 2007 - Strange Behaviours in applying Master Pages across subsites

I was at a client site today and we were experiencing the following problem:

When you create a sub-site underneath the home site and use say the 'Team Site' template, switching to the home site and applying a Site Master Page (with the children inherit option checked), this new site does not inherit the change. When you navigate to the new team site it complains saying 'The system master page setting currently applied to this site is invalid. Please select a new master page and apply it'.

The answer is:
All WSS templates that are also included in MOSS (including pages) actually inherit their setting from the System Master Page setting, not the Site Master Page setting. The Site Master Page is not used. Only in MOSS-specific templates, such as a Publishing site, is there Site Master Page usage and System Master Page usage. So to fix this, from the home page Master page settings page, select 'System Master Page' select the master page you want and check the 'Reset all subsites' option.