Friday, March 25, 2011

How to restore SharePoint 2010 Site Templates especially for Sites migrated from MOSS

After much painful debugging, I managed to resolve the issues related to Site Template save and restore for SharePoint 2010 based Sites. I noted that the SharePoint 2010 site itself had corrupted lists "Calendar", “Issue” etc (which does not get migrated properly from MOSS), which I had to delete and then created a new lists (such as “IssuesRegister”) in SharePoint 2010 and painfully relinked all workflows, data views, dispforms etc. I also deleted all the master pages (starting with clarity_) and styles library as they were remains from MOSS/SharePoint Online instance and was causing incompatibility issues. Anyways after all this, I saved the site as Site Template and EUREKA IT WORKED!!

Once I got the Site Template, I restored the site on new server and got a series of missing features exceptions (with correlation IDs - for example "The site template requires that the Feature {e34b0b8e-6e21-49ad-8d2f-530a29d61175} be installed on the farm or site collection"). I painfully debugged through each missing feature ID and learned the following (in a very painful way again)
1)   Ensure that all Site Collection and site Features in Source and Destination SharePoint servers are identical.
2)   I used the Powershell script Get-SPFeature -Site <Site Collection name> | Sort Id | FT DisplayName,Id to get all features deployed and matched against the list of feature names from here against the corresponding missing feature complained by SharePoint 2010 on the new box. Once I identified the feature missing, I went ahead and enabled the feature (see point 2 below)
3)      The Following features are required for restoring all SharePoint 2010 Site Templates that were migrated from MOSS (For e.g. - http://shp2010test is the new server where I tried restoring the new site based on SharePoint 2010 Template) – USING POWERSHELL:
a.       Enable-SPFeature LocalSiteDirectorySettingsLink -Url http://shp2010test
b.      Enable-SPFeature InPlaceRecords -Url http://shp2010test
c.       Enable-SPFeature SignaturesWorkflow -Url http://shp2010test
d.      Enable-SPFeature HelpLibrary -Url http://shp2010test
e.      Enable-SPFeature LocationBasedPolicy -Url http://shp2010test
f.        Enable-SPFeature OpenInClient -Url http://shp2010test
g.       Enable-SPFeature MobileExcelWebAccess -Url http://shp2010test
h.      Enable-SPFeature TaxonomyFieldAdded -Url http://shp2010test
4)      Strangely there was no theme applied to new site and so I had to reset the theme on this new site to inherit from parent and EUREKA! The site was live and all workflows seems to be working ok!

Anyways all my pain and suffering today would hopefully lead to more seamless and easy migration from SharePoint 2007 to SharePoint 2010 and then moving migrated sites between SharePoint 2010 servers.

Sunday, March 13, 2011

Hide List Columns on Display, Edit and New Forms using JQuery

Follow the steps below to quickly hide List Columns on Display, Edit and New Forms using JQuery:
1) Create a scripts library in your site (or use the one you currently use to store your Javascript/*.js files)
2) Download the latest version of the JQuery file from here - http://code.jquery.com/jquery-1.5.1.min.js
3) Copy the above *.js files (namely "jquery-1.5.1.min.js") to the scripts folder created in Step 1
5) Open the form/page (such as NewForm.aspx or EditForm.aspx) where you want to hide editable list columns and add the following script at the end of the page (preferably below the end </style> tag:


<script language="javascript" type="text/javascript" src="/board/scripts/jquery-1.5.1.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
  $(nobr:contains("All Day Event")').closest('tr').hide();

});
</script>
6) Ensure that you replace the List Column name that you want to hide in the above script sample
7) Also note that on DispForm.aspx, you need to slightly modify the above script and look for "h3" tag instead of "nobr" tag in the above script

Auto populate current logged in user name in SharePoint 2010 People Picker control

Follow the steps below to Auto populate current logged in user name in SharePoint 2010 People Picker control:
1) Create a scripts library in your site (or use the one you currently use to store your Javascript/*.js files)
2) Download the latest version of the JQuery file from here - http://code.jquery.com/jquery-1.5.1.min.js
3) Dowload the latest version of the SPServices JQuery library from here - http://spservices.codeplex.com or http://spservices.codeplex.com/releases/55660/download/171214
4) Copy the above *.js files (namely "jquery-1.5.1.min.js" and "") to the scripts folder created in Step 1
5) Open the form/page (such as NewForm.aspx) where you want to default the People Picker control to the current user logged in and add the following script at the end of the page (preferably below the end style tag:


<script language="javascript" type="text/javascript" src="/board/scripts/jquery-1.5.1.min.js"></script>
<script language="javascript" type="text/javascript" src="/board/scripts/jquery.SPServices-0.6.0.min.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function() {
 var userName = $().SPServices.SPGetCurrentUser({
  fieldName: "Name"
 });
 $("textarea[title='People Picker']").val(userName);
 $("div[title='People Picker']").text(userName);
});
</script>








Note - you need to replace the src property values above to reflect the correct path to the Javascript files downloaded in above steps and saved in the "scripts" folder.

Saturday, October 30, 2010

Creating performance counter category Enterprise Library Caching Counters.An exception occurred during the Install phase (Enteprise Library 4.1 October 2008)

Solve this weird issue by running "lodctr /r" (from Start > Run) or command line. For additional reference on what this command means check the TechNet article at : http://technet.microsoft.com/en-us/library/dd363694(WS.10).aspx

Thursday, September 02, 2010

Innovative Business solutions for the Cloud

Check out how this Microsoft GOLD Partner is leveraging the Microsoft Cloud to deploy "business solutions" readily deployable on the Cloud - http://portalnow.iqgroup.com

Wednesday, August 18, 2010

The form cannot be rendered. This may be due to a misconfiguration of the Microsoft SharePoint Server State Service

Fix this issue very quickly by following the steps below:
1) Open up the SharePoint 2010 Power Shell Command Prompt (can be found by clicking Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell locally on the SharePoint 2010 web server.
2) Run the following commands (in the sequence as mentioned below):
a. $serviceApp = New-SPStateServiceApplication -Name “State Service”
b. New-SPStateServiceDatabase -Name ”StateServiceDatabase” -ServiceApplication $serviceApp
c. New-SPStateServiceApplicationProxy -Name ”State Service” -ServiceApplication $serviceApp -DefaultProxyGroup

Wednesday, May 12, 2010

There is no file with URL 'IWConvertedForms .cvt' in this Web.System.IO.DirectoryNotFoundException: There is no file with URL 'IWConvertedForms/

A very annoying error for sure. Easily resolved by deactivating and reactivating the feature "IPFSWebFeatures" found %Program Files%/%Common Files%/microsoft shared/web server extensions/12/Template/Features

Use the following commands:

stsadm -o deactivatefeature -filename IPFSWebFeatures\feature.xml -force -url

stsadm -o activatefeature -filename IPFSWebFeatures\feature.xml -force -url

Tuesday, May 11, 2010

When creating a new site from a custom STP site template file, you get the "File Not Found" error after site is created

The problem could be that the master page did not map properly. To check and correct the problem, you have to "cheat" by directing your browser to the new site's master page settings page. That is done by replacing "default.aspx" in the current URL with "_Layouts/ChangeSiteMasterPage.aspx" e.g. http://site/web/default.aspx becomes http://site/web/_Layouts/ChangeSiteMasterPage.aspx.

After the page loads, you should see two error messages noting problems with both the site and system master pages.

In the Site Master Page section, ensure that the "Specify as master page to be used by this site and all sites that inherit from it" radio button option is selected. In the drop down below it, ensure that the "default.master" is selected. Scroll down to the System Master Page section. Ensure that the "Select a system master page for this site and it's subsites to inherit" option is selected and once again set the dropdown below to "default.master". Scroll down to locate the "OK" button and click it to reset the site master pages and fix the site.

Tuesday, April 06, 2010

Tips and Tricks to get CKS Forms Based Authentication Solution working properly

Codeplex FBA (http://cks.codeplex.com/releases/view/17901) is a great tool and its configuration is defined in great detail on this article (http://devcow.com/blogs/jdattis/archive/2007/02/23/Office_SharePoint_Server_2007_Forms_Based_Authentication_FBA_Walkthrough_Part_1.aspx). However there are a few gotchas to take care of when configuring MOSS on Windows Server 2008 box:

1) After you update the hosts file with the names such as:
127.0.0.1 projectextranet.test.com
127.0.0.1 projectextranet
After you create the SharePoint Application and Site collection successfully and try to access the site, you would notice that when you try to access either of the above sites through IE, it will prompt you for a username and password and the logon prompt keeps appearing that will eventually timeout. The quick fix for this is explained here - http://support.microsoft.com/kb/896861/en-us (apply the Microsoft Fix tool)

2)Once you have configured your FBA and you try to add the spadmin user created in the steps as described in article above through Central Administratio for the extranet site, it will not resolve the name. This error happens if your Central Administration Application Pool account does not have access to the FBA database created earlier. So make sure you give at least db_owner access to the Central Admin App Pool account and then perform iisreset. EUREKA! Now it will find your users in FBA DB

3)You get an error "Dependency feature with id 01aa8d8b-000a-4c35-8f4f-5d1280377650 for feature 'FBAManagementSelf' (id: 23c44729-fb03-4882-a0bf-c6fb3ddd81fd) is not installed." - Fix this by downloading the latest copy of FBA here (http://cks.codeplex.com/Project/Download/FileDownload.aspx?DownloadId=97072). Compile and build the deploy folder using WSPBuilder and then use the new CKS.FBA.wsp file to deploy to your farm

Wednesday, February 24, 2010

how to activate SharePoint Tool Basket Language files when using sptoolbasket from Codeplex

Simple yet tricky this little annoying thing when deploying the SPTOOLBASKET from Codeplex (http://sptoolbasket.codeplex.com/releases/view/21960). In order to activate the Document Ratings Feature, you need to activate prior the feature named "SharePoint Tool Basket Language files". But wait a minute this cannot be activated from Site Settings > Site Collection Features. You would need to do this for the Web Application via Central Administration > Manage Web Application Features (and select your web app). Simple as that but can be annoying to figure out especially if you are working on a project burning the midnight oil!

How to create a Windows Shell Right Click command to easily add your WSP to the Solution Store

How to create a Windows Shell Right Click command to easily add your WSP to the Solution Store.
Open regedit.exe and then make following changes in registry

Right Click on "HKEY_CLASSES_ROOT" and create a New Key called ".wsp" and set the value to "wspfile"

Right Click on HKEY_CLASSES_ROOT\wspfile and create a New Key called "shell"

Right Click on HKEY_CLASSES_ROOT\wspfile\shell and create a New Key called "Add Solution"

Right Click on HKEY_CLASSES_ROOT\wspfile\shell\Add Solution and create a New Key called "command" and set the value to "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\BIN\stsadm.exe" -o addsolution -filename "%1"

Note in all the above values, make sure you remove the first and last inverted commas on values

Now go back and open Windows Explorer and locate your WSP file on your file system. Right Click on that file with your mouse and EUREKA you will find "Add Solution" as a new Windows Shell command. Select this option to add the WSP to the MOSS Solution Store

Friday, February 19, 2010

Site collection could not be restored. If this problem persists, please make sure the content databases are available and have sufficient free space

This has to be one of the most difficult issues I had to solve with restoring a previously created SharePoint backup. Here are the different steps (based on your own scenario) I took to solve the above problem and restore my site collection:

Scenario 1)
This issue occurs if the computer that is running Windows SharePoint Services has insufficient free disk space that is available to host the restored Windows SharePoint Services Web site. This issue may also occur if the Windows SharePoint Services database has reached its maximum allowed size.


Scenario 1 Solution) To resolve this issue, make sure that the computer that hosts the Windows SharePoint Services Web site has sufficient free disk space that is available before you restore the Windows SharePoint Services Web site. When backing up or restoring large site collections make sure that the site collection is set to "no access" if it exists already. Whether the site collection exists or not the -overwrite parameter can be used to bypass conflicts. stsadm -o restore -url -filename -overwrite



Scenario 2) The site collections listing page will give a clue.The site you were trying to restore was already listed there but when you tried to load it the site didn't work.

Scenario 2 Solution) •Detach and Reattach each of the content db's , this removed the site collection listing from CA but the error still occurred
•Run stsadm -o databaserepair against the database's and it removed a bunch of orphaned records.



Scenario 3) There is tonnes of disk space (20 GB free for the restore of a 3 GB site collection) and tried again. It died with the same error. You run the following query in the SQL Server Management Studio:

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

As it turns out, the database server was trying to restore the site collection into was running SQL Server Express Edition had a file size cap of 4 GB. When this "farm" was set up, it was done so with a Basic install which by defaul installs SQL Express and inherits it's limitations. The site collection that was used was trying to restore broke the 4 GB limit and as a result the stsadm tool thought there wasn't any disk space available, when really there was a bunch to be had.

Scenario 3 Solution) Upgrading SQL Server Express to Developer/Standard/Workstation/Enterprise -
As a result upgrade the OFFICESERVERS instance of SQL Server running on that machine from Express to Developer (you can upgrade it to Developer/Standard/Workstation/Enterprise, whatever you have in terms of media/licensing). This ends up being pretty easy, you simply find the media/installer and run the setup.exe that you normally would but with an added argument of SKUUPGRADE=1.

setup.exe SKUUPGRADE=1

When the install wizard gives you get a chance, select the OfficeServers instance and upgrade the database engine. If you want a more detailed walkthrough, one is available here. When you're done, run the same SQL query above and the product edition should no longer be Express. After that small adventure, the restore will work like a charm.



Scenario 4) A lot of transactions in the ULS Logs and SQL Server Logs are growing out of control during the restore process that appear to interrupt the restore, especially if its a very large one.

Scenario 4 Solution) Try the following:
1. Stop IIS
2. Perform the Restore
3. Restart IIS
Basically you are preventing any SharePoint transaction from taking place while you perform the restore.


Scenario 5) Restore runs super slow (for example 6 hrs for a restore of 7 GB backup file) and right at the end throws the "insufficient space" error.

Scenario 5 Solution) Try the following:
1) Delete the Web Application (incl. content database) (OPTIONAL STEP IF YOU ARE OK TO DELETE - MAKE SURE YOU HAVE A DATABASE BACKUP AND STSADM FULL SITE COLLECTION BACKUP)
2) Truncate content database transaction logs in SQL Server
3) Turn Mirroring off on all databases on the SQL Server
4) Ensure that the account performing restore has dbowner and dbcreator permissions

Monday, November 30, 2009

Searching internal documents is not working. The search service indexes all the documents ok, no errors in the logs etc but no results are displayed

Check the alternate mappings as this usually is the issue. For example if the default mapping is http://sitename.companyname.com/sites/sitename1 it would index but not display the results. Changing the default value to http://server (which is the server name of the MOSS web server) and the Extranet mapping to http://sitename.companyname.com/sites/sitename1 then the results will be displayed.

Sunday, November 08, 2009

Team Collaboration lists such as Calendar, Tasks lists are unavailable within moss publishing site - How do i fix this?

Very Simple - Goto Site Settings > Site Administration > Site Features and Activate the "Team Collaboration Lists" feature

An error occurred during the compilation of the requested file, or one of its dependencies. The type or namespace name 'Publishing' does not exist

As simple as this error sounds - "An error occurred during the compilation of the requested file, or one of its dependencies. The type or namespace name 'Publishing' does not exist in the namespace 'Microsoft.SharePoint' (are you missing an assembly reference?)", it can be tricky to solve.

The easiest solution I have found to solve is to include the following snippet below your includes in your master page.

<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

<%@ Register TagPrefix="PublishingVariations" TagName="VariationsLabelMenu" src="~/_controltemplates/VariationsLabelMenu.ascx" %>
<%@ Register Tagprefix="PublishingConsole" TagName="Console" src="~/_controltemplates/PublishingConsole.ascx" %>

<%@ Register TagPrefix="PublishingSiteAction" TagName="SiteActionMenu" src="~/_controltemplates/PublishingActionMenu.ascx" %></strong>

Saturday, November 07, 2009

How to fix the issue "A feature with ID ... has already been installed in this farm. Use the force attribute to explicitly re-install the feature."

Use -force flag on your deploy operation. For example:

stsadm -o deploysolution -name MyBranding.wsp -immediate -force
stsadm -o execadmsvcjobs
stsadm -o activatefeature -name Mybranding -url http://testurl -force

Monday, October 05, 2009

The minimum accounts you need to install MOSS using MS recommended best practices

Ok - I have been asked this question several times and have also noticed that the right accounts are not used during MOSS installations. Here is a quick summary of all the accounts you need pre-configured in your AD prior to installing MOSS:

  • mosssetupUSER – Pass@word1 – Moss Setup user – Member of: Administrator – SQL: dbcreator and security-admin
  • sqlserversrvc – Pass@word1 – User to create db’s and sql configs – Member of: Administrator – SQL: dbcreator and security-admin
  • caapooldbaccessUSER – Pass@word1 – caa app pool USER acct and to access db – Member of: Administrator – SQL: dbcreator and security-admin
  • sspappool@AIFSMOSS.local Pass@word1 = SSP App Pool Identity – User rights and entitlements assigned automatically
  • sspserviceUSER – Pass@word1 – SSP Timer/Web Services – User rights and entitlements assigned automatically
  • WssSearchSrvcUSER – Pass@word1 – used for wss search – User rights and entitlements assigned automatically
  • searchcontentaccessUSER – Pass@word1 – default user for search content access – User rights assigned automatically
  • searchspccontentaccessUSER – Pass@word1 – user for search specific content access – read access to external content source
  • userprofilesaccessUSER – Pass@word1 – USER who access the AD and user properties – read rights to AD
  • excelservicesUSER – Pass@word1 – USER to access excel content soruces – read rights to excel content sources

Thursday, August 13, 2009

Why should i care about WSP / solution packages in MOSS

Often I find developers writing custom batch scripts, stsadm commands to deploy their customizations ( Site definitions, field types, event receivers, workflow, and features) to MOSS staging/production farms. This is considered a very bad practice due to the following reasons (but not limited to):
1) A farm disaster happened but luckily you had your scripted backup of your farm. But when you restore, web parts are throwing errors
2) Unable to isolate the WebPart errors as the WebParts were manually installed
3) What about WebPart dependencies? Forgot to restore them!
4) Ok I got the WebPart somehow working (VS debugging etc) but wait where are the images?
5) What about the killer Web.config changes in new farm? Did you back that up too?
6) Now that you fixed the WebPart and customizations somehow, how will you deploy this fix to each server in the farm - manually? What if there are 16 servers in the farm?

Bottomline, always wrap up your customization as a solution package (WSP) prior to deploying to MOSS farm. Even your custom Cascading Style Sheet (CSS) files, .aspx pages, and master pages will need to be deployed via WSP if they are to be used farm-wide. As a general rule, if the item in question will affect the entire farm it will likely need to be deployed via WSP.

Best practices steps to create a WebPart

When writing your own custom web part, always remember to execute the following steps:

1. Wrap the web part as a *.dll to be deployed to the web application BIN directory to ensure that code access security can be applied.
2 .Create a *.webpart XML file that will specify the above *.dll, namespace, and class for the Web Part and defines properties for it.
3. Create a Feature.xml file that is one of two files used to copy the .webpart XML file to the Web Part gallery of the site collection.
4. Create an Elements.xml file that is one of two files used to copy the .webpart XML file to the Web Part gallery of the site collection.
5. Write a safe control entry for the web application's web.config file that grants permission for your Web Part to run.
6. Set Code access security policies that define what the Web Part will be allowed to do

Once you finish coding your webpart, create a deployment package (*.WSP) before installing/deploying to your farm

Wednesday, July 29, 2009

Free SharePoint tools from leading vendors - DOWNLOAD TODAY!

Download these free SharePoint tools / add-ons from the following leading vendors:
  1. Bamboo Solutions "Mashpoint" - Access external data sources directly from SharePoint, visualize and interact with them via Web Parts or custom applications
  2. Idera SharePoint Performance Montoring Tool - Free tool that enables easy monitoring of critical performance counters for SharePoint, IIS and Windows Operating Systems.
  3. AvePoint FREE Tool for Item-level SharePoint Restores - delivering full fidelity, item-level restore capabilities directly from live SQL and DPM databases and backups.
  4. Quest SharePoint Discovery Wizard - Find out how many Microsoft SharePoint servers, site collections or sites are on your network. Discovery Wizard for SharePoint freeware gathers critical data about your SharePoint inventory and displays the discovered results in two easy-to-read, HTML reports.