Building public-facing websites using SharePoint 2007: Planning

ObjectSharp has been working with SharePoint technologies for years now: building public facing websites and intranet for the clients, developing custom SharePoint web parts and features, designing custom templates, and so on... Oh yes, I forgot to mention hundreds of hours of SharePoint training (public and private) for developers and power users that we have taught to our clients. But, despite this tremendous amount of SharePoint expertise ObjectSharp has built up internally, we never had time to move our own corporate website to Microsoft Office SharePoint Server 2007 platform. Long story short, finally, the vast benefits from moving to SharePoint platform outweighed the problems with dedicating our own internal resources to this project, and we have received a go ahead to proceed with the project. As a project manager for this SharePoint migration project, I would like to share with you the experience and the certain amount of wisdom we have gained from this project of moving our original "sophisticated and fancy-looking" website to the SharePoint-based web content management platform.

 

Goals

As in any other project, we have identified the goals that will determine if the projects have been successful or not:

  • SharePoint-based website must look exactly (or as close as possible) as our original website
  • SharePoint-based website must keep all existing functionality of the original website (public and administrative parts). All additional features for the new site will be added in the future website versions.
  • SharePoint-based website must leverage existing SharePoint features and minimize the amount of custom code as much as possible
  • The migration has to be transparent to our clients and the effect on our SEO ranking should be minimal

 

Planning infrastructure for SharePoint environment

To properly plan the infrastructure for SharePoint environment we need to know

  • What are we going to use SharePoint for?
  • What features of SharePoint will be utilized?
  • How many visitors do we expect on the website? What's the expected server load?
  • What will be the expected size of the website? How often will the website be updated?
  • What are the performance requirements for the site?
  • What are the availability requirements?
  • What are our disaster recovery policy and standard maintenance schedules?

Here is an excellent link for estimating performance and capacity requirements for SharePoint servers: http://technet.microsoft.com/en-us/library/cc262405.aspx. Also if you require redundancy and availability in your SharePoint environment here are the guidelines from Microsoft for that: http://technet.microsoft.com/en-us/library/cc263044.aspx and http://technet.microsoft.com/en-us/library/cc748824.aspx.

 

Planning the development and production environments

It's always a good idea to separate development environment from the production environment. D'oh! Ideally, you will have separate SharePoint farm for developers, testers, content authors, and, of course, separate SharePoint farm for production.

  • An authoring environment in which site content will be authored and approved for publication. This will also be the environment that site designers use to create layouts, master pages, and other site artifacts. This environment includes an Office SharePoint Server 2007 farm along with the workstations that site designers, authors, and editors use.
  • A development environment in which custom site elements will be developed. This includes developer server workstations, a source control system, and a small Office SharePoint Server 2007 integration farm for integrating the various coded elements and testing them by using sample content.
  • A production environment in which the Internet presence site is available to site visitors. This includes two server farms:
    • The primary publishing farm
    • A parallel but smaller farm that provides failover in case the primary farm becomes unavailable, and that also will be used to pilot new site features.

For more information visit http://technet.microsoft.com/en-us/library/cc263209.aspx

 

Determine website structure and navigation

To comply with the project goals we needed to keep the existing site structure and navigation, so we have copied over the website structure to the new site. Luckily, SharePoint allows you to shape your site structure any way you want. We have created a single web application for our website, as it's more than sufficient. We have enabled anonymous access to the web application. We have also extended this web application to include support for SSL.

Now, we had to find the way to transfer our navigation menu to the new site. One of our consultants and Microsoft MVP, Justin Lee, had an answer for us: to use ASP.NET menu control with CssFriendly adapter. With a minimum of configuration tweaking and no custom code necessary we're able to get the menu transferred within an hour or so, but let's not jump ahead J

 

Determine authored elements: custom master pages, stylesheets, page layouts, content types, web parts, etc.

At this point, need to come up with a draft of what and how many master pages will we require, what kind of page layouts do we need, what stylesheets and javascripts will be included in master pages or page layouts, what content types and site columns we need to create, what web parts and/or features we need to develop, and so on and so forth. Basically, we need to try to determine the kind of content that will be added to our website, and the best way we can implement those authored elements.

Because master page will be loaded with every page, you need to make sure that your master page(s) contain only the minimal amount of content. In other words, only include primary stylesheet and javascript files to the master page to make sure that your pages load fast(er). Microsoft has an excellent guide on how to create minimal master page. Please note that minimizing the number of master pages will help to promote the consistency of styles and branding throughout your site (ideally, you would have only one master page).

When determining the page layouts and content types required for the website, you need to know what kind of content will be present on the page(s) and how it will be displayed to the public. I usually compile a list of different type of pages that the website will have, along with the list of entries that will be displayed on those pages. Having an original wireframe for the website will make this process so much easier.

Almost all content in our new SharePoint-based website will be in a form of a web part. Fortunately, SharePoint has a lot of built-in web parts that will be able to accommodate most of the content to be moved. Content Editor webpart, Content Query webpart, Image webpart are three web parts that you will probably use the most on your website. Naturally, sometimes your website will require functionality that SharePoint does not support out of the box, so Microsoft has provided the tools that will help you to develop all kinds of custom features. You need will to download Microsoft Office SharePoint Server 2007 SDK, SharePoint Extensions for Visual Studio 2008, and, of course, the copy of SharePoint DLLs from the SharePoint server! Please note, you can find a lot of information for SharePoint developers at http://www.microsoft.com/click/SharePointDeveloper/

 

Now it's time for a little bit of SharePoint branding and development….



Related resources:

Deploy SharePoint Central Administration to more than one server in the SharePoint farm

There is a lot of conflicting information on the net whether it's possible to have more than one SharePoint server hosting SharePoint Central Administration site in the farm. I know for the fact that it's possible to have more than one server hosting SharePoint Central Administration site to provide high availability for that part of the SharePoint environment. Here is it can be done:

  • Let's say you have two SharePoint servers: Server A and Server B. Server A hosts SharePoint Central Administration site, Server B doesn't
  • To add SharePoint Central Administration site functionality to the Server B, run SharePoint Configuration Wizard on the Server B and at the "Completing the SharePoint Products and Technologies Configuration Wizard" step, click on Advanced Settings
  • Select "Use this machine to host the website" to add SharePoint Central Administration site functionality and hit OK. Click Next to start the configuration wizard
  • After the configuration wizard completes successfully, you will have additional server providing Central Administration functionality. To verify that it's in fact true, open SharePoint Central Administration site and under Farm Topology you should have Central Administration functionality listed under both servers.

How to Fix “The file exists. (Exception from HRESULT: 0x80070050)…” error on SharePoint

If you're getting the error "The file exists. (Exception from HRESULT: 0x80070050)", when you attempt to access your SharePoint site, or even SharePoint Central Administration site, the chances are that some (or all) SIDs on your server were changed. This has probably happened because you have removed and recreated some user accounts that you use to run SharePoint services, or you have run sysprep on your server, or you have recently turned your SharePoint server into Active Directory domain controller. It's not a good idea to do any of those things with your SharePoint server, but I'm not here to judge – I'm here to help J

Please note, that the steps described below is a "low-tech" solution to the problem, which requires you to actually understand what you're about to do. USE AT YOUR OWN RISK!!! And, of course, do not forget about backups, backups, backups. Also, I would like to point out the credit for this solution goes to the blog and his/her author that is no longer online.

Anyway, to solve "The file exists. (Exception from HRESULT: 0x80070050)…" error:

  1. Login to your SharePoint and open SQL Server Management Studio. Create New Query
  2. To get the list of Site IDs you need to use SharePoint_AdminContent_* database for Central Administration Site and run the following query:
    SELECT s.Id, w.FullUrl FROM Sites s inner join Webs w on s.RootWebId = w.Id
  3. As a result of the query above, you will see all Site IDs for the selected database. Now, using that data, run a new query:
    SELECT * FROM UserInfo WHERE tp_Login='Hostname/Username' and tp_SiteID='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    where tp_Login is the hostname and username using which you're trying to login to SharePoint; and tp_SiteID is the site ID from the previous query
  4. As a result of the query above, you will see the SID for the selected user. Now, here comes the tricky part, you need to get SID number for the user account that you're logging in with (in my case, it was Administrator account) and convert it to hexadecimal format:
    1. To get SID for a user account, you can use PSTOOLS utility. Run PSGETSID \\HOSTNAME USERNAME to get SID info
    2. To convert the SID to hexadecimal format, use the following VB script and run it against the SID obtained in the previous step: sid2gex.vbs mySID, where my mySID is the SID for the user account you're working with. As a result, you will receive SID in the hexadecimal format.
  5. Now we will update our database table with newly obtained SID using:
    UPDATE UserInfo SET tp_SystemID = 0x010500000000000000000986BD9EA976E44036C3F5D3F04040000
    FROM UserInfo
    WHERE tp_ID = '1' and tp_guid='XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX' and
    tp_Login='hostname\username' and tp_SiteID = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX'
    where tp_ID, tp_guid, tp_Login and tp_SiteID are the attributes of the user account for which we want to update tp_SystemID. Note: you might have to repeat those steps for the services accounts which are running your search, shared services provider, etc.

After implementing the steps above, you might have to update service accounts in the SharePoint configuration. Microsoft has an excellent guide on how to make those changes.

Join SharePoint server to the Active Directory domain

If you need join existing SharePoint server to your Active Directory domain, then you're in for a treat. Joining the SharePoint server to the domain will mess up the authentication in SharePoint and cause errors. To join SharePoint server to the Active Directory domain without breaking SharePoint authentication:

  • Back up all SharePoint content databases and all customizations that you have made to the SharePoint (stylesheets, javascript files, image files, web parts, config files, and so on)
  • Uninstall SharePoint completely from the server
  • Join the server to the Active Directory domain
  • Reinstall SharePoint Server (make sure to use different names for content databases)
  • Restore your SharePoint content databases
  • Add restored content databases to the SharePoint web application(s) using "stsadm -o addcontentdb" command
  • In SharePoint Central Administration >> Application Management >> Content Databases, change status of existing content databases to Offline, and set the status of the recently restored database to Ready
  • Copy over the customizations that you have backed up in the beginning (stylesheets, javascript files, image files, config files, and so on) and install missing web parts, features, solutions, etc.

That should be it. Simple, right? J

No process is on the other end of pipe

If you receive "No process is on the other end of pipe…" error when you attempt to connect to the SQL Server 2005, then check if:

  • SQL Server services are running
  • remote connections enabled
  • port settings are correct
  • DNS gets resolved properly
  • firewall is not preventing you from connecting successfully
  • and so on and so forth…

And, if after all of these checks the error is still displayed, then the bad certificate could the one to blame. In order to be successfully loaded by SQL Server 2005, a certificate must meet all the following requirements:

  1. The certificate must be in either local machine or current user certificate store
  2. The certificate must have a good time stamp, i.e. the current system time must be in the valid time window of the certificate
  3. The certificate must be meant for Server Authentication
  4. The Certificate's key spec must include AT_KEYEXCHANGE property.
  5. The certificate's subject CN must match the FQDN of the server machine or the FQDN of the virtual server if the server runs on failover cluster.

If for some reason the server cannot find a valid certificate, then the server will issue a self-signed certificate to encrypt data communication between the server and client. The login packet will always be encrypted, while the data communication will be encrypted only if the server and the client are configured to do so. Anyway, to resolve the issue with the certificate, do the following:

  • Open SQL Server Configuration Manager; under SQL Server Network Configuration right-click on Properties for your SQL instance, and click on Certificate tab. Then make sure that the correct and valid certificate is selected, and then reboot your SQL Server.
  • If invalid certificate is explicitly specify, then remove that certificate
  • Otherwise, Open Personal Store in Certificates (Local Machine and User) management console, backup all certificates in that folder and then remove all certificates from personal store
  • Reboot your SQL Server
  • To make sure that self-signed certificate has been loaded, open ERRORLOG file for your SQL Server and search for "A self-signed certificate was successfully loaded for encryption" line in the log file.
  • Attempt to reconnect to the SQL Server

Creating custom list from hidden Event content type

For some reason, Microsoft has decided to hide Event content type in SharePoint (MOSS/WSS) and prevent users from creating a custom list based on that content type. To unhide Event content type:

  1. Open your existing calendar on the site and go to List Settings
  2. Click on Advanced Settings and change the settings to "Allow Management of Content Types", which will reveal the Event content type in that list settings
  3. Click on the Event in the list of content types
  4. Under List Content Type Information click on the Parent link, which is strangely enough also called Event
  5. Under Settings click on the "Name, Description & Group" link and assign Event content type to the new group, for example "List Content Types". That's it, from now on you will be able to create custom lists based on the Event content type

 

There is another way to unhide Event content type, and even though I find it less graceful, I think it's worth mentioning:

  1. Go to [Drive]:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES\ctypes\ folder and backup the contents of that folder
  2. To unhide Event content type, run
    stsadm -o deactivatefeature -filename "ctypes\feature.xml" -url http://[SharePointWebApp]
    and
    stsadm -o activatefeature -filename "ctypes\feature.xml" -url http://[ SharePointWebApp]

Master page cannot be loaded…

There is an interesting bug in SharePoint Designer: sometimes when you browse SharePoint pages in the design view of the SharePoint Designer, you will see an error stating that the master page cannot be loaded. At that point you get presented with two options: either attach a different master page or work in the code view. Neither of those options actually solves the problem, they just allow you to work around it. I have never liked workarounds; I prefer solving the problems instead of working around them. J

With a little bit research I have found that the reason why my custom master page cannot be displayed in SharePoint Designer is that the default master page (default.master) has been checked out. Once I have checked in the master page, SharePoint Designer went back to displaying my master pages in the design view.

Please note that sometimes SharePoint Designer locks up the pages if you have checked out the page and then closed the application without checking in the page. So, you will have to check out the page and then check it back in. Sometimes, the only way to do is that is through the Site Content and Structure part of the SharePoint site.



Related resources:

Issue with migrating custom list templates

If you're trying to export custom list template (with or without content) from one SharePoint collection or farm to the other, you might notice that your recently imported list template does not appear on the "Create Page" page of that site, which means that you cannot use the new template to create new list. This issue appears to be caused by the fact that your list definition ID of the new custom template is different

The workaround is to:

  • After you have imported your template, go to List templates section (Site Actions >> Site Settings >> List Templates) and write down the Title and Feature ID fields.
  • Now create new empty custom list and call it EmptyList
  • Create new list template based on the EmptyList (Settings >> List Settings >> Save List as Template)
  • Now when you try to create new list, you will see EmptyList on the list gallery. If you hover your mouse over the EmptyList item in the list gallery, your browser's status bar should display the URL similar to:
    http://SHAREPOINT/_layouts/new.aspx?NewPageFilename=EmptyList%2Estp&FeatureId={00bfea22-ec85-4403-972d-ebe475780216 }&ListTemplate=100
  • Replace the NewPageFilename and FeatureId entries with the values noted at the step one. Your new URL will look something like that:
    http://SHAREPOINT/_layouts/new.aspx?NewPageFilename=ImportedListName%2Estp&FeatureId={00bfea71-de22-43b2-a848-c05709900100}&ListTemplate=100
  • Copy modified URL to the address bar and hit Enter
  • Configure the name and the description of the list and hit Create. Your newly created list will be based on the imported list template.

Be cautious of the automatic web part installers

If one beautiful morning your SharePoint designers complain that they now get "The server sent a response which SharePoint Designer could not parse…" error when they try to edit SharePoint page or page layout, and/or your SharePoint developers all of the sudden are unable to access any of the SharePoint services under _vti_bin folder (like _vti_bin/lists.asmx), then check your web.config file. The tags in <httpHandlers> section in web.config file are probably out of order.

<remove verb="*" path="*.asmx" /> tag needs to be posted before any of the <add > tags in <httpHandlers> section in web.config file, otherwise the SharePoint web services path configuration breaks.

In our case this issue was caused by the web part install that incorrectly modified web.config file to configure AJAX in SharePoint. I guess the lesson is always be cautious of the automatic web part installers J

SharePoint and Vista: a problem with “Explorer View” and “Create list from spreadsheet”

We have recently encountered a problem with some of the SharePoint (WSS or MOSS) features not working properly in Windows Vista:

  • When users attempt to display a document library in the Explorer view within the web application that uses Kerberos authentication, nothing happens: Explorer view never comes up and no errors displayed either
  • Or, when users attempt to display a document library within the web application that uses NTLM authentication, they get "Your client does not support opening this list with Windows Explorer" error;
  • When users attempt to create list from Excel spreadsheet they get "Method 'Post' of object 'IOWSPostData' failed" error

After a lot of research and many unsuccessful attempts to fix these problems using various solutions found on the web, I have finally able to find a workaround that have worked on Windows Vista 32-bit.

Solutions that did not work in our situation:

  • Installing and enabling WebDav on IIS 7
  • Installing Desktop Experience on Windows 2008 server 64 bit
  • Modifying EXPTOOWS.XLA macro file to force using a different version number
  • Etc…

The workaround that worked:

  • Install hotfix KB945015 on the client machine to fix a bug caused by an extra forward slash mark (/)appended to the query path of a WebDAV PROPFIND request
  • Install Web folder hotfix on the client machine to get Vista map a drive to a web location on SharePoint
  • Map a "Web Network Location" on your PC to the root of the SharePoint site in question and ensure that you save the credentials

This workaround only worked for Windows Vista 32-bit.



Related resources: