Search This Blog

Monday, September 30, 2013

What is the difference between Item.Update() and Item.System.update()?

Generally when we try to add/edit a SPListItem using SharePoint Object Model? Yes I know it! Almost everybody have common answer to this (which is similar to what is provided below).
       SPListItem item = SPList.Item.Add();
       Item[“Col1”] = “Value for Col1”;
       Item[“Col2”] = “Value for Col2”;
       Item.update();
The last line in the code above "item.Update()" does the final task of updating all the assigned value for that specific item within the SPList.
But is this the only way to update an item? No, we can also update the same item using item.SystemUpdate();

Then what is the difference between the two?

With item.update(), we update the changes that are made to the list item. Is that all what it does? No, internally it also updates the “ModifiedBy” and “ModifiedOn” fields as per the current logged in user and current server time. Optionally it also updates the version of the item if the versioning option is turned on for that specific list.
So, at any point if we wish not to update these extra things I.e. the “ModifiedOn” , “ModifiedBy” and the “Item Version”, then the solution for it is to use item.SystemUpdate() instead of item.Update().This will help you in updating only those fields which are specified within your code blocks.

 Conclusion: item. Update () will update the changes that are made to the list item as well as “ModifiedBy”, “ModifiedOn” and “ItemVersion” If Version is enabled.

item.SystemUpdate() will updates the changes that are made to the list item only, it will not update the “ModifiedBy”, “ModifiedOn” and “ItemVersion”.


Thursday, September 26, 2013

Site Collection Backup and Restore in SharePoint 2010

Site Collection Backup and Restore in SharePoint 2010

We work tirelessly to create, edit, and enhance sites and site collections; sometimes making hundreds of hours of changes. It would be a shame to lose all of this work simply because no one backed-up the site collection and disaster struck.
The backup and restore processes are both simple, and easy to use. The most important part of the process is knowing that a site collection backup can be done either from Central Administration or from Windows Management Shell; however a site collection restore can only be done via Windows Management Shell.

Site Collection Backup:

No matter which method you use, you must first create a folder to store the backup.
If you choose to use Windows Management Shell the next step is to run a backup script.

The script follows the syntax: Backup-SPSite <SiteCollectionURL> –Path <BackupFile>
The great thing about backups is that you can name your file, so if you need to number your backups or base the name on the site collection, it is a simple task.

If you choose to use Central Administration, the process is done through the User Interface:
Central Administration > Backup and Restore > Perform a site collection backup
Which leads you to this page:
From here you can choose the site collection you wish to backup, and then specify the location where the backup file will be stored- in this case it is the same location used via Windows Management Shell.

If you are not sure of the URL of the site collection you wish to backup then Central Administration is a safer route because you can browse through all site collections to find the one you wish to backup. However, if you have many site collections and already know the URL then Windows Management Shell is easier to use.

Site Collection Restore:

Remember, a site collection restore can only be done via Windows Management Shell:
The restore script follows similar syntax to the backup script: Restore-SPSite <DestinationSiteCollectionURL> -Path <BackupFile> [-Force]
In this case the Force command is in brackets because it is optional- if you already have a site collection at the specified URL you must force the restore, but if the URL is not being used then you don’t need the Force command.
It is a good idea to backup the site collections once a week. The operation is simple, but can take up space if you start backing up daily so be cautious as to how often you backup, and be sure to delete old backups.

The Top 50 SharePoint Sites:

As SharePoint continues to grow in popularity within organizations large and small, the number of SharePoint related online resources has skyrocketed. There are a lot of excellent ones, so we thought we’d put together a list of our 50 favorites.
Please note that this is by no means an exhaustive list of all the great SharePoint sites out there, nor is it in any particular order. If you find there’s a blog or site that hasn’t been included in this list that you think is awesome, then leave us a comment and let us know!

  • SharePoint Joel
  • NothingbutSharePoint
  • Wonder Laura
  • SharePoint in Education
  • CMS Wire
  • Portals and KM
  • Andre Connell
  • 21 Apps
  • Dave Coleman’s SharePoint and Technology Blog
  • Nauplius
  • Broculos
  • ShareMuch
  • Jeremy Thake’s Musings
  • Randy Drisgill
  • Stefan Gossner’s Technet Blog
  • Paul’s Project Server Blog
  • TN Chris Bortlik’s Blog
  • The Guide of Mobile MOSSLover
  • Fear and Loathing
  • Chris O’Brien’s The Nuts and Bolts of SharePoint
  • SharePoint Adam
  • Adis Jugo: The Southern Side – SharePoint Bits and Bytes
  • SharePoint Javascripts
  • Furuknap’s SharePoint Corner
  • Marc D Anderson’s Blog
  • SharePoint Analyst HQ
  • Harbar.net
  • Views from Veronique
  • Point Beyond
  • A Soldier of Fortune
  • Tobias Zimmergren
  • The SharePoint Viking
  • Todd Klindt’s SharePoint Admin Blog
  • Microsoft…what else?
  • Rez’s SharePoint Blog Spot
  • Dot Net Mafia
  • Meet Dux
  • Eblogin
  • Matthias Einig: SharePoint, TFS and Powershell
  • Seb 2.0
  • Elio Struyf
  • John Chapman’s SharePoint Blog
  • Metalogix
  • David Lozzi’s Blog
  • Salaudeen Rajack’s SharePoint Diary
  • KWizCom SharePoint Blog
  • Tom Resing’s SharePoint Blog
  • Chris McNulty’s KnowPoint
  • Cameron Dwyer: OnePlaceMail, SharePoint, Outlook & Life’s Other Little Wonders
  • SharePoint Dev Notes
  • SharePoint Wendy