Emad's Blog

Thoughts/Tips/Shortcuts/Ideas from a .NET software engineer

Archive for January, 2009

Good Links, January 30, 2009

Posted by emadmagdy on January 30, 2009

Reserved SharePoint Query string IDs (FeatureId, ListTemplate, List, ID, VersionNo, ContentTypeId, RootFolder, View, FolderCTID, Mode, Type) : http://blogs.technet.com/stefan_gossner/archive/2009/01/30/querystring-parameters-you-should-not-use-in-your-sharepoint-application.aspx

SharePoint Dispose check tool, this tool will analyze assemblies that deal with SharePoint and tried to identify if all SharePoint objects used are correctly disposed: http://code.msdn.microsoft.com/SPDisposeCheck

Posted in Good Links, SharePoint | Leave a Comment »

A very quick way to restore SharePoint site collection (way quicker than stsadm -o backup/restore)

Posted by emadmagdy on January 23, 2009

The conventional wisdom for moving a SharePoint site collection between farms is to backup the site collection using the stadm -o backup on the source server and then use stsadm -o restore on the destination server.

This approach is very neat and straight forward and works very well in most cases. The problem is with large site collections ( starting from a few GBs); with sizes in the GBs, this process might takes a very long time.

An alternative and much quicker way to backup and restore a site collection is using SQL Server backup and restore for the content database. SQL Server backup restore is way faster than stsadm backup/restore for large site collections.

Here are the steps needed:

  1. Identify the content database for the site collection. (in case you are not sure, check central administration->applications management-> content databases).
  2. From SQL server, backup this database and restore it to a new database.
  3. On the destination server, create a new site collection using the same template. As a result, a content database for the newly created site collection is created. ( note its name as we will delete it later from SQL server)
  4. On the destination server, go to central administration -> application management, content databases, Select the site collection and then select the existing database and remove it. Now the site collection has no content database.
  5. go to command line and use the command stsadm -o addcontentdb to attach the restored database to the site collection.
  6. Bingo ! ( in a fraction of the time needed for stsadm backup/restore)

Notes:

  • You must first remove the existing content database before adding a new one. This is because it seems that SharePoint is looking for the top level site on that one and you must delete it first to force it to look for the top level site in the newly attached database.
  • Trying to simply restore the database over the one just created by SharePoint with the creation of the new site collection will not work.

Posted in SharePoint | 1 Comment »

Good Links, January 19, 2009

Posted by emadmagdy on January 19, 2009

Tool to make sure that the feature used by a site collection is already installed: http://code.msdn.microsoft.com/WssAnalyzeFeatures

Completely remove a feature from a site collection: http://code.msdn.microsoft.com/WssRemoveFeatureFrom .this handles the problems when a site collection has a feature that is not installed (or is corrupt on the farm), in that case, stsadm -o deactivate will fail. This tool comes to the rescue in that case.

Posted in Uncategorized | Leave a Comment »

Good Links, January 17, 2009

Posted by emadmagdy on January 19, 2009

Posted in Good Links | Leave a Comment »

Good Links, January 13, 2009

Posted by emadmagdy on January 13, 2009

Firebug 1.3 released: https://addons.mozilla.org/en-US/firefox/addon/1843

Top 25 most dangerous programming mistakes: http://www.codinghorror.com/blog/archives/001210.html

100 Interview Questions for software developers: http://www.noop.nl/2009/01/100-interview-questions-for-software-developers.html  – These are more like conversation starters.

Posted in Good Links | Leave a Comment »

Good Links, January 12, 2009

Posted by emadmagdy on January 12, 2009

Posted in Good Links | Leave a Comment »

Custom SharePoint Forms with Attachments

Posted by emadmagdy on January 12, 2009

There was a known problem when trying to add attachments to a customized SharePoint forms. that caused an error saying “This form was customized not working with attachment"

Microsoft has "fixed" this issue with the SharePoint Services infrastructure updates (http://support.microsoft.com/kb/953271)

Please note the following to make this fix work:

  • Make sure to change ALL instances of ControlMode to "Edit"  in case of the Edit form and "New" in case of the new Forms.
  • It is NOT enough to hide the Original un-customized web part, you may need to CLOSE it.

Posted in Tips | Leave a Comment »

Good Links, January 9, 2009

Posted by emadmagdy on January 9, 2009

Posted in Good Links | Leave a Comment »

Good Links, January 3, 2009

Posted by emadmagdy on January 3, 2009

Collection of cheat sheets: http://www.addedbytes.com/cheat-sheets/

More Cheat sheets for developers: http://refcardz.dzone.com/home?page=1

Free E-book about Entity Framework: http://weblogs.asp.net/zeeshanhirani/archive/2008/12/05/my-christmas-present-to-the-entity-framework-community.aspx

Collection of free technical e-books :http://www.freetechbooks.com/  (Note: this is a repository of links to e-books offered and hosted by many different web sites)

Posted in Good Links | Leave a Comment »

Good Links, January 2nd, 2009

Posted by emadmagdy on January 2, 2009

Posted in Good Links | Leave a Comment »