Friday, June 1, 2012

SPWebService.CollectSPRequestAllocationCallStacks property

There was a time when you had to restart a lot of stuff after editing registry entries like  : KEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\HeapSettings        SPRequestStackTrace = 1

to get the root cause of memory leaks and all that stuff.

Now you have property  SPWebService.CollectSPRequestAllocationCallStacks .  This is a diagnostic setting that facilitates the debugging of leaks of SPSite and SPWeb objects. If not disposed properly these objects can hold onto large amounts of memory. By enabling this setting, traces in the trace log that report leaks will contain callstacks. However, callstack collection is expensive so this should only be enabled during a brief diagnostic period.

Powershell :

$MySvc = [Microsoft.SharePoint.Administration.SPWebService]::ContentService
$MySvc.CollectSPRequestAllocationCallStacks = $true | $false


Monday, May 28, 2012

Microsoft.SharePoint.Taxonomy Migration of Taxonomy


I have server1 with Microsoft.SharePoint.DLL version  14.0.5123.5000  in farm1 .

  1. I took Content DB backup of Site collection SC1 on this server 1 along with Taxonomy DB backup on server 1 .

  2. I restored these DB's on Server2 ( Microsoft.SharePoint.DLL version  14.0.4762.1000)  SQL DB .

  3. Created a new Taxonomy Meta Service with  restored MetaService DB backup on Farm2.

  4. Created a new web application and site collection with restored Content DB from Server1  on Farm2.

  5. Manually run the Taxonomy Update Scheduler Timer Job.

  6. When I create a new item/ edit an on Server 2, a new entry is created in TaxonomyHiddenList and a new entry under termStore "System".

  7. Even though I have same term present in my custom Termstore in a termset !!!!

The ideal behavior should be , on server 2 , new item should be tagged to my custom term in predefined termset and termstore .

Please guide me what step I am missing.

Reply 1

Let's try a different approach. Instead of trying to create the service from a backup, we can export the data and import it into a new metadata service:

  1. Delete the Managed Metadata service in Farm 2.

  2. Create a new Managed Metadata service in Farm 2. Note the application pool account.

  3. In farm 1, from an elevated SharePoint Management Console window, run the Export-SPMetadataWebServicePartitionData cmdlet. This will create export the managed metadata data into a cabinet file (.CAB):

Export-SPMetadataWebServicePartitionData -Identity "http://sharepointsite" -ServiceProxy "ManagedMetadata Service Proxy Name" -Path "C:\Temp\"

  1. opy the .CAB file from farm 1 to a folder on the farm 2 SQL Server. Share this folder and give Everyone Full Control sharing permission (we will clean this up later)

  2. In farm 2 SQL Server Management Studio, give the Managed Metadata application pool account (from step 2) bulkadmin SQL Server role (Expand the server instance -> Expand Security -> Find the account -> Right click, Properties -> Server Roles Page -> Check bulkadmin -> Click OK)

  3. In farm 2 SharePoint server, from an elevated SharePoint Management Console window, run the Import-SPMetadataWebServicePartitionData cmdlet to import the data:

Export-SPMetadataWebServicePartitionData -Identity "http://sharepointsitefarm2" -ServiceProxy "New Managed Metadata Service Proxy Name" -Path "\\SQLServerName\Share\"

You'll need to update the URLs and names to reflect your environments.


Reply 2

Hello Jason

Thanks for your great help. With the migration commands you shared also , I was getting the same problem.

The source of the problem in my case was :

After recreation / DB restoration /migration of Taxonomies , few of the properties in my User Profiles had lost the mappings, I had to manually remap them to get the things working.

Reply 3 

After everything I am facing below mentioned: ( To sum up I will rewrite all steps I did)\

  1.        I have server1 with Microsoft.SharePoint.DLL version  14.0.5123.5000  in farm1 .On Farm 2 Microsoft.SharePoint.DLL version  is 14.0.4762.1000

  2.        The Farm1 and Farm2 are exact replica ( created from same content DB) and Taxonomies also being same with same GUIDs of Term Store and sets and Terms.

  3.        I created a new term under my custom term set on Farm1 . Used  Export-SPMetadataWebServicePartitionData  and  Import-SPMetadataWebServicePartitionData   (OverwriteExisting)  to migrate changes in Terms  to Farm 2

  4.        Edited an existing content in Site Collection 1 to refer to the new term.

  5.        Now I used Deployment API’s to take incremental export of site collection 1 .

  6. The import process on Site Collection2 on farm 2 create two entries in TaxonomyHiddenList !! These two entries have same Title, IdForTermStore, IdForTerm, IdForTermSet etc . Only difference is the SPITEM ID .

  7.        All the functionalities of my site work fine. But I am not sure why these two entries should be there in TaxonomyHiddenList !!!

After each step above I run the Taxonomy Update Scheduler Timer Job on Site collection 2 web application. Manual TaxonomySession.SyncHiddenList also did not help.

Seems to be one entry in TaxonomyHiddenList came from content migration of TaxonomyHiddenList itself and the second entry came as include dependency of list item edited which refer to this new  Term. Might be the case ?

As the import Log mention The import Process on Site Collection2 refer to TaxonomyHiddenList Twice :

[5/30/2012 11:08:46 AM] Start Time: 5/30/2012 11:08:46 AM.
[5/30/2012 11:08:46 AM] Progress: Initializing Import.
[5/30/2012 11:08:46 AM] Progress: Starting content import.
[5/30/2012 11:08:46 AM] Progress: De-Serializing Objects to Database.
[5/30/2012 11:08:46 AM] [Folder] [Person] Progress: Importing
[5/30/2012 11:08:46 AM] [Folder] [Person] Verbose: Source URL: _catalogs/users/Person
[5/30/2012 11:08:46 AM] [Folder] [Item] Progress: Importing
[5/30/2012 11:08:46 AM] [Folder] [Item] Verbose: Source URL: Lists/TaxonomyHiddenList/Item
[5/30/2012 11:08:46 AM] [Folder] [myLibrary] Progress: Importing
[5/30/2012 11:08:46 AM] [Folder] [myLibrary] Verbose: Source URL: myLibrary/Forms/myLibrary
[5/30/2012 11:08:46 AM] [File] [sitemap.xml] Progress: Importing
[5/30/2012 11:08:46 AM] [File] [sitemap.xml] Verbose: Source URL: sitemap.xml
[5/30/2012 11:08:46 AM] [File] [sitemap.xml] Verbose: Destination URL: /sitemap.xml
[5/30/2012 11:08:46 AM] [ListItem] [xyz.pdf] Progress: Importing
[5/30/2012 11:08:46 AM] [ListItem] [xyz.pdf] Verbose: List URL: /myLibrary
[5/30/2012 11:08:46 AM] [ListItem] [xyz.pdf] Verbose: Deleting...
[5/30/2012 11:08:47 AM] [ListItem] [53_.000] Progress: Importing
[5/30/2012 11:08:47 AM] [ListItem] [53_.000] Verbose: List URL: /Lists/TaxonomyHiddenList
[5/30/2012 11:08:47 AM] [ListItem] [272_.000] Progress: Importing
[5/30/2012 11:08:47 AM] [ListItem] [272_.000] Verbose: List URL: /_catalogs/users
[5/30/2012 11:08:47 AM] Verbose: Performing final fixups.
[5/30/2012 11:08:47 AM] Progress: Import completed.
[5/30/2012 11:08:47 AM] Finish Time: 5/30/2012 11:08:47 AM.
[5/30/2012 11:08:47 AM] Duration: 00:00:00
[5/30/2012 11:08:47 AM] Total Objects: 11
[5/30/2012 11:08:47 AM] Finished with 0 warnings.
[5/30/2012 11:08:47 AM] Finished with 0 errors.

My migration process export only the content which is published . If I give a tweak in the process it works:

1. Create an item which is not published using the new term on server 1 . This populates an entry in TaxonomyHiddenList. Let this Term in TaxonomyHiddenList migrate in next export import migration.

2. Now before next migration cycle , Publish the item which was refering to new term on server 1 . After next migration , the updated item goes to server 2 and there is no extra term in TaxonomyHiddenList onserver 2.

Reason: Probably import process on Server 2 is taken care by SharePoint as a Transaction. Now TaxonomyHiddenList Import and refering item import is under single transaction. So the item does not get reference to the newly created / imported taxonomy hidden list entry and hence trigger a new spitem creation in the taxonomyhidden list.

If we don't want to use powershell for Taxonomy migration and want to stick to db migration, there is a way out, restart SQL server just before db restore on target , so that there may be no connection Live to the managed db at the time of restore.

If we try to point the old service to a new DB instead(on the target,where new db is restored from the source meta db), some mappings may be lost for the termsets to the Columns in the list.

You may also like:

System KeyWords for Managed MetaData Service

SharePoint 2010 strange behavior of Taxonomies under Migration from one

Wednesday, May 16, 2012

Microsoft.SharePoint.Deployment SPExportSettings



ExportChangeToken property in SPExportSettings  is something which tells SharePoint API's a point in past from which the incremental export should start .


CurrentChangeToken  (ReadOnly) is something which is set internally , and referred by future exports as a mile stone for export process.This property is set  the when some change occurs in site or when the increamental batchis complete ?


I have a batch which runs perfectly under ideal conditions.



I want that when I run this batch manually , value of CurrentChangeToken  should not be persisted in the system,

so that automatic batch process keeps on running as is & my manual run is free enough to export without any affect on the automatic.



Please help.

1. Is it ok to create my own persisted object store of SPChangeToken , let the Batch use it to get last value and add new token there with CurrentChangeToken   value.  The manual process do not update the custom persisted object , so last in the persisted object is the one by automatic process.





I have one last resort for me , if I don't find direct API's in Deployment name spaces :  SPSite.GetChanges Method (SPChangeToken, SPChangeToken)

In this case I want to know Microsoft.SharePoint.Deployment.SPExportSettings.CurrentChangeToken  (ReadOnly)  property is set internally after the export has run  or it is independent of when export runs , but dependent on when actual change occurs.

Reply 1



Under content migration scenarios from staging to Production on daily basis , how  Microsoft.SharePoint.Deployment API's are better performer than ?

Friday, March 23, 2012

SharePoint 2010 | Login over HTTPS from HTTP pages

Hello Friends


Did you ever have a chance to work on Login control for SharePoint which sends user’s credentials on SSL and rest of the stuff non-secured?  I found few of the good links which suggest creating our own custom Cookie handlers.

Microsoft SharePoint Team has written their own cookie handler specific to SharePoint which does not allow authentication token being generated on a secured connection to be used under non-secured. 1st thing, Do you see any kind of harm in overriding this behavior of SharePoint’s cookie handler with our own custom one ? Second,I was able to transfer back the cookies using  this approach as in the links below, but current context was lost, and user remained to be logged off !!!







Steps I followed:

1. Extended the current setup on SSL . Made it working similar to the default zone application ( including resource files and web.config entries,manual dll etc.)

2. Set the postback url for login button.

3. Made the URL rewrite entries as suggested in both zones. ( these are spread across multiple links, REQUEST_METHOD is additional to https ON rule) URL rewriting can be done very easily with an IIS extension provided by Microsoft.

4. Created the custom handler as suggested and replaced it with SharePoint one.

5. Set the required SSL for cookies to false, so that they may be used on non ssl also.


Reply 1

The two bindings should be given under same zone , only then it works. I was giving the alternate access mappings under different zone.

So with  custom cookie handler with both end point under same zone , it works! !


Reply 2

Hello hemantrhtk


Thank you for your post.


This is a quick note to let you know that we are performing research on this issue.




Pengyu Zhao


Reply 3

The two bindings should be given under same zone , only then it works. I was giving the alternate access mappings under different zone.

So with  custom cookie handler with both end point under same zone , it works! !

Monday, March 12, 2012

SharePoint 2010 | mix mode authentication with ntlm and sql providers | Browser issue



I have a web application claim based with ntlm and sql provider ( mix mode authentication). The default login page of SharePoint 2010 , allows me to login the site on Mozilla 10 and Google  crome,

but on IE 8 and 9 , it does not redirect me anywhere after windows authentication pop up, nor the user is able to access the application pages by typing url directly ( means there is a problem in authentication rather than redirection only)


I have tried allowing all cookies and adding the site in trusted zone on IE 8 and 9 , but no luck

I had given a   hostheader different to the server name, when I revert it back to server name/blank,   I was able to use default SharePoint login page perfectly fine.

This is when hostheader had a DNS entry also in place !!!


Make sure javascript is not disabled. A next step could be to install Fiddler and check which requests/responses are sent over.

Reply 2

Are you forced to actually enter a username and password using IE? This might imply a kerberos misconfiguration?

Reply 3


Have you checked Remember me in the login page?

If yes, please try to do some changes in web.config file:

<cookieHandler mode="Custom" path="/" > changed it to:

<cookieHandler mode="Custom" path="/" persistentSessionLifetime="60">

For more information, please refer to:


Xue-mei Chang



Friday, March 2, 2012

Migration from MOSS 2007 to SharePoint 2010 Infopath does not work

We are facing an issue to connect my SharePoint 2010 application with InfoPath Designer.

The site collection for which we are getting this error is migrated from MOSS 2007 to SharePoint 2010.For other applications which are created in SharePoint 2010 itself (no migration) , everything works fine.

While we are trying to connect to migrated application ,we are getting error :


‘This feature requires SharePoint 2010 or greater with InfoPath  Forms Services enabled’


We did below points to troubleshoot this issue but didn’t get any success :(  and


  • Activated the "SharePoint Server Enterprise Site Collection features" at Site / Web level

  • Checked Enterprise CAL Licence on the server .


However when we tried to connect another web application in the same farm that is working fine .



Please suggest any workaround if  anyone has faced this kind of problem before, we would greatly appreciate his / her inputs.

Reply 1

Hi hemantrhtk,

May be you haven’t activate it on your the top-level site .Go to the top-level site of wherever your site is, go to the Site Settings > Site Collection Features, and ensure the Enterprise Feature is activated here.

This is also may be InfoPath compatibility problems, you can delete the item relate InfoPath , then recreate it on your SharePoint 2010 environment.



Hello Jack


We have tried this also as per the links shared above.

Reply 2 by

Hi Hemant ,

Find your solution at :

Vivek Shukla

Wednesday, February 8, 2012

SharePoint as Multilingual Solution - Comparison with other products


I need a comparison sheet of SharePoint 2010 with other products with respect to multilingual support . Other products could be : Google Sites, Hyper Office,  Documentum, Alfresco , Oracle Beehive, Jive, O3 Spaces, Mindtouch ,Lotus Vignette,  Drupal, Salesforce an so on.


Reply 1

I don't think a sheet like that exists. I found a couple of interesting links for you:

Hopefuly they contain useful information for you. One good thing to remember is that users always have to translate content to the other language. All the system settings (such as settings and default columns) are translated. I don't know how to other products work compared to SharePoint.

You also buy a platform with SharePoint so you can use it for lots more then a multilingual solution.

Blog: Twitter: @JasITConsultant