Friday, December 26, 2008

Migrating SharePoint /MOSS 2007 database from one Farm / DB to another Farm /DB

In case you are performing any one of these activities then you are looking at right blog :
1) Migrating Portal from One Farm to another Farm
2)Migrating Portal from Development/Test Server to Production Server

I would like to put this process in order to make other's life simpler.If you are performing these migration /move and facing these errors then you have to follow this blog :

An unexpected error occurred while refreshing the shared object manager cache.
Reason: Object reference not set to an instance of an object.
Techinal Details:System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.Office.Server.Administration.SharedResourceProviderStoreDependency.get_IsValid() at Microsoft.Office.Server.Administration.SharedObjectManager.Refresh()

"The search service is currently offline. Visit the Services on Server page in SharePoint Central Administration to verify whether the service is enabled. This might also be because an indexer move is in progress. "

Process for Farm Migration

1)Back up Complete Farm using Central Administration (Central Administration > Operations > Perform a Backup )
2) Disconnect from existing Server farm using SharePoint Products and Technologies Configuration Wizard
3) Create New Farm using "SharePoint Products and Technologies Configuration Wizard" in desired DB server and Web Server
4)Most important STEP , if you miss this you will end up with all kind of search errors in world
Start all services in that server

  • Excel Calculation Services
  • Office SharePoint Server Search
  • Windows SharePoint Services Help Search
5)Restore farm back using Central Administration (Central Administration > Operations > Restore from Backup )

Once you are done you might get this Error :
Following Web Part error in the page: “One of the properties of the Web Part has an incorrect format. Windows SharePoint Services cannot deserialize the Web Part. Check the format of the properties and try again.”

Suggestion: The AppPool may not have appropriate permissions
Do this ,

  • GO TO Central Administration (Central Administration > Operations > Service Accounts)
  • Select Web Application Pool option
  • Select the Central Administration Web app from drop down
  • Provide Account ID to be used by web application

One More Pit Fall After Migration :

Infopath Managed form stops working . If you have Infopath Managed form in your site upload the same to (Central Administration > Application Management > Manage Form Templates )

Well these steps might help to make migration much simpler .

Also refer this excellent blog post for process with image depiction:

Tuesday, December 16, 2008

SharePoint List/Content Rating System

I am working on rating system for SharePoint list and got this excellent sample in codeplex.

It seems to work great with Custom List, Issue List , Document library and Link list but unfortunately lacking the most important list (Discussion Board). 

Well i am still trying to figure out ways to integrate the same engine to Discussion Board , if i get something it will be soon in my blog.


What are Content Type IDs?

Excellent Article in order to understand Content Type IDs.

Monday, December 15, 2008

Redirecting to same Page ASP.NET

Simple concept but still pain in head if unable to figure out :)


Tuesday, December 02, 2008

Application synchronization failed for Microsoft.Office.Server.Search.Administration.SearchService..


Application synchronization failed for Microsoft.Office.Server.Search.Administration.SearchService.
Reason: Object reference not set to an instance of an object.

Resolution :
The following worked with me , i hate to say this but i have no clue what went wrong and why this started working .

In order to get search working i did the following steps and all other options didn't worked even given here in microsoft discussion group

  • Start the search using Central Adminsitration -> Operations -> Services on Server ->Click "Start" for "Office SharePoint Server Search "

  • Select only "Use this server for serving search queries". Provide credentials and Press "OK". This should atleast start the search service

  • Now go back go Central Adminsitration -> Operations -> Services on Server ->Click Link "Office SharePoint Server Search"

  • Select "Use this server for indexing content" too and provide credentials and Press OK

  • This was start indexer too

  • Now go forward and create a new SSP. Now you will see indexer available in dropdown

Hope it works for others too.

Monday, November 24, 2008

Backup / Restoring SharePoint 2007 Site from SQL Database

I got this excellent article on SharePointdogs for backup / restoring the SharePoint site from SQL DB :

Here is one of defined approach which worked wonders for me :

Using SQL, Backup the SQL Content Databases which are required and Restore them to a new databases in the SQL and attach these databases to the new application.
(Briefly we can say that take your content db ‘Offline’ using the Central admin. Take the content database offline in SQL Studio (Take Offline context menu item). Copy your database mdf and ldf files to the new machine (the destination machine). Attach the copies on the new SQL server using SQL Studio. Add the copied content DB to the Web Application on the new machine using the Central Admin on the new web server.)
1)Find the content Database
These are listed under Central Admin->Application Management->Site Collection List
2) Backup the content database
You could alternatively detach it, and copy it. Just doing a backup in SQL Server 2005 Management studio is easier.
3) Restore content database to new server
Copy the BAK file to new server. Create an empty DB in Management Studio, restore from backup, you may need to change an option in the “options” tabof the restore dialog to get it to work. (Overwrite db).
4) Create Web App on new Server
Central Admin->Application Management->Create or extend Web App->Create New Web App.
5) Associate restored DB with new Web App
Central Admin->Application Management->
SharePoint Web Application Management->Content Databases->
Remove Content Database from your new web app.
Now use STSADM to add restored DB to this web app
c:\program files\common files\microsoft shared\web server extentions\12\bin on new server is where you can find the STSADM.
run this command from there.
stsadm -o addcontentdb -url http://yourwebapp:port -databasename yourcontentdb -databaseserver yoursqlserver
6) Run ISSRESET from command prompt.

Tuesday, November 11, 2008

Setting RSS Update time limit in SharePoint 2007

My previous blog on RSS ended with a very un-satisfied note as i was still trying to find the way to set the update time for RSS feeds in SharePoint 2007 . I am glad i got it now. It was a setting in Site Collection Level . Here it goes :

  • Go to Site Settings

  • In Site Adminisration Section click on link RSS

  • Set the Time To Live(Minutes) filed with required refresh time

Outlook 2007 RSS feed not updating when Sync with SharePoint 2007 List

I had issue wherein my Outlook 2007 RSS was not updating once new data is added to the SharePoint List. After lot of brain damage it came to my notice that it starts working when i remove the "Update check box " as shown in figure below while adding the New feed.Well i am still working on actual issue and trying to understand how to define content feed publisher time limit.

Tuesday, November 04, 2008

Get Discussion List Items from SharePoint Discussion Forum

If you are trying to retrieve all the root items of the Discussion List this way , it's not going to work :
SPSite site = new SPSite("Site URL");
SPWeb web = site.OpenWeb();
SPList list1 = web.Lists["DiscussionListName"];

SPListItemCollection coll = list1.Items ;

Well Here is the right way of doing it :-)
SPSite site = new SPSite("Site URL");
SPWeb web = site.OpenWeb();
SPList list1 = web.Lists["DiscussionListName"];
SPListItemCollection coll =list1.Folders ;

Friday, October 10, 2008

This page has encountered a critical error. Contact your system administrator if this problem persists.

ERROR:"An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. "

Do you get this error in your sharepoint site ?

Just one bad day you come in to see that your main page is bombing due to this error with no proper clue .Well it happened to me and i had no idea what went wrong.After lot of research i found something.

I had "?" marks all over my web.config file , which even erased some of characters.

Solution :

Search for "?" in web.config and start fixing the character in the file. I would suggest replace the web.config (obviously retain the custom entry ) with working one , i replaced my web .config with a working one and Volla!!! it worked for me .

In short the culprit is web.config and not SharePoint installation.


If this helps do leave comments , i would like to know how many SharePointeers got into this issue. :-)

Wednesday, October 01, 2008

Restricting MySite Create Access in MOSS 2007

Ever thought of restricting the MySite creation access and to allow very few user to create there personal site ?
Then this is for you :

Open Shared Service Provider Administration Page and click on link as shown in image to specify the access level of users .

Do leave message if this helps you. It's good to know i am not the only one having this requirememt :)

Friday, September 05, 2008

Sharepoint ListTemplateId

GenericList 100
DocumentLibrary 101
Survey 102
Links 103
Announcements 104
Contacts 105
Events 106
Tasks 107
DiscussionBoard 108
PictureLibrary 109
DataSources 110
WebTemplateCatalog 111
UserInformation 112
WebPartCatalog 113
ListTemplateCatalog 114
XMLForm 115
MasterPageCatalog 116
NoCodeWorkflows 117
WorkflowProcess 118
WebPageLibrary 119
CustomGrid 120
DataConnectionLibrary 130
WorkflowHistory 140
GanttTasks 150
Meetings 200
Agenda 201
MeetingUser 202
Decision 204
MeetingObjective 207
TextBox 210
ThingsToBring 211
HomePageLibrary 212
Posts 301
Comments 302
Categories 303
IssueTracking 1100
AdminTasks 1200

Tuesday, August 19, 2008

Copy / Extract DLL from GAC

Ever wondered how to retrieve dll from GAC ?

Well here is one way :

  • Open command prompt and go to c:\windows\assembly\gac

  • Required dll will be in form of a directory, change directory to to the dll (cd {dll name})

  • Check directory for folder name (dir)

  • Change directory to folder with long name

  • You will get the dll in this folder

  • Run copy command to copy to your desired directory


Thursday, July 17, 2008

An error occurred while attempting to retrieve the KPI value from the list

Ever encountered this error while tying to play with KPI for first time ?
Well i had , listing the causes which might throw this error:
  • Make sure the columns are all available in the default view, else try selecting "All Document" view first
  • I read that creating KPI in different site collection might throw this error, but never tried myself

In case looking for complete explanation of KPI , check out webcast :


Wednesday, May 07, 2008

File Not Found on NewDwp.aspx in SharePoint when adding a web part

Do u receive this error and wandering what the hell is wrong with your portal:

File Not Found. at System.Signature._GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, IntPtr fieldHandle, IntPtr methodHandle, IntPtr declaringTypeHandle) at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandle fieldHandle, RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle) at System.Signature..ctor(RuntimeMethodHandle methodHandle, RuntimeTypeHandle declaringTypeHandle) at System.Reflection.RuntimeMethodInfo.get_Signature() at System.Reflection.RuntimeMethodInfo.GetParameters() at Microsoft.SharePoint.WebPartPages.SPWebPartSerializer.GetPersonalizableProperties() at Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetEffectiveWebPartType(Type webPartType, SerializationTarget serializationTarget, Boolean ignoreSupportsAttributeMarkup) at Microsoft.SharePoint.WebPartPages.SPWebPartManager.GetEffectiveWebPartType(Type aspWebPartType, SerializationTarget serializationTarget) at Microsoft.SharePoint.ApplicationPages.NewDwp.Page_PreRender(Object sender, EventArgs e) at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnPreRender(EventArgs e) at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Problem is due to 2 factors:
1) You might have installed Smart Part web part in your server
2)and you don't have installed the ASP.NET AJAX installed in your server

To correct install the ASP.NET Ajax extension 1.0 from Microsoft Site

Restart server and you might get some relief.Do leave a message if it helps , helps me to understand how many got stuck in my situation :)

Article by david helped me ...

Tuesday, May 06, 2008

Thursday, April 10, 2008

The specified schedule recurrence string is invalid: every 1 minute. MOSS ERROR

I got this error while creating a new site collection , i was wondering what might have caused this issue. The last thing i was playing with was custom alerts and the error showed something is messed up with the timer schedule. I thought of checking the interval set for scheduled jobs and Volla!!! i had set the immediate job timer to "every 1 minute " which is not a correct string .

So solution is to reset the property :

I used the follwong command to set the timer :

stsadm -o setproperty -pn job-immediate-alerts -pv "Every 5 minutes between 0 and 59"

and all worked great :)

Friday, March 14, 2008

Thursday, March 13, 2008

Wednesday, March 05, 2008

Smartpart for SharePoint with Ajax Support

An excellent article by Jan tielen's

Friday, February 29, 2008

Database Maintenance for SharePoint Whitepaper

Wednesday, February 20, 2008

Item Information Returned by MOSS Alert

I was trying to access the item values in order to customize my email color scheme but after a long search it came to my notice that only few item details are returned by alert . In case you want to access other information in list , you need to write your own alert component as given in following link

Friday, February 15, 2008

Custom Alert Template to a specific list

Create a new custom template with a unique Name attribute in your working copy of AlertTemplates.xml (You can copy paste the entire section with Name SPAlertTemplateType.GenericList, change the name and modify the sections you want to). Modify the template as necessary. After restarting IIS, write object model code to set the list alert template
SPAlertTemplateCollection ats = new SPAlertTemplateCollection((SPWebService)(WebApplication.Parent)); //give appropriate values for WebApplication
list.AlertTemplate = ats[“name from above”];

Tuesday, February 12, 2008

Custom Alert MOSS

Override the existing default alert with your custom component

Your custom email alert handler should be configured at this point. Create a new alert and you should get the updated custom email.

Check out STSADM Timer Job for alerts details :

Friday, February 01, 2008

Friday, January 25, 2008

Error Integration MOSS Picture Library with Silverlight

Silverlight error message
ErrorCode: 4001
ErrorType: ImageError

I got this error while implementing the MOSS picture library with Silverlight . I was following the article by Ian Morrish

but due to some reason i got stuck with this error , after some hours of brain shakedown it came to my notice that the Picture library was not properly referenced in my XSLT .

Friday, January 18, 2008

Migrating List and Document Libraries in MOSS between servers

List / Document Library Migration

Have you ever got the requirement of just migrating a list/Document Library between servers and not the whole site ?

Well then you are at right place, just down load the tool and start migrating the list with all metadata intact .

Happy Migrating !!!

Download Tool

User Profile Import is not importing updated Manager Information from Active Directory in MOSS


User profile is imported and everything seems to work fine , later there is a change in organization structure for eg there is a manager change for person "x" .In order to reflect this information in sharepoint , you update the information in Active Directory and run import .

Issue :

SharePoint still showing the old manager for person"x" and doesn't seemed to be updated with profile import

Resolution :

Install WSS /MOSS SP1 and you are good to go ....

Thursday, January 17, 2008

Printing SharePoint Web Part

Ever thought of printing a content of web part rather than complete page in sharepoint ?

Follow the Steps:

  • Create Print Button : Add content Editor web part to your page and paste the following script as Source Text

< type="button" onclick="javascript:void(PrintWebPart())" value="Print Web Part">

< language="JavaScript">
//Controls which Web Part or zone to print
var WebPartElementID = "WebPartWPQ6";

//Function to print Web Part

function PrintWebPart()
var bolWebPartFound = false;
if (document.getElementById != null)
//Create html to print in new window var PrintingHTML = '\n\n';
//Take data from Head Tag if (document.getElementsByTagName != null)
var HeadData= document.getElementsByTagName("HEAD");
if (HeadData.length > 0)
PrintingHTML += HeadData[0].innerHTML;
PrintingHTML += '\n\n\n';
var WebPartData = document.getElementById(WebPartElementID);
if (WebPartData != null)
PrintingHTML += WebPartData.innerHTML;
bolWebPartFound = true;
{ bolWebPartFound = false; alert ('Cannot Find Web Part'); } } PrintingHTML += '\n\n'; //Open new window to print if (bolWebPartFound)
var PrintingWindow ="","PrintWebPart", "toolbar,width=800,height=600,scrollbars,resizable,menubar");; PrintingWindow.document.write(PrintingHTML); // Open Print Window PrintingWindow.print(); }}< /script>

  • In order to print content from web part you need to connect the desired web part to the print button
  • Get the Div Id of web part from the Page Source and assign it to the variable in Button

Well you would like to check this for simpler explanation :

Wednesday, January 09, 2008

Granular Level Export/Import of data MOSS

Have you ever wondered what if u have to migrate just a list between servers ,do you need to buy third party tool . Nopes...

Just create a tool using API from Microsoft.SharePoint.Deployment Namespace and it's not as complex as you might think .

Check this great article with samples :

Happy Coding and New Year!!!

Gray Failures: What is it and how to detect one?

If you are reading this article , i guess you are curious to know about gray failures and different methods to detect gray failures.  Hopefu...