How to: Migrate events from a SharePoint Calendar to the Calendar E-Mail Extension

Applies to the Calendar E-Mail Extension.

In this post I will describe how to migrate existing events from a standard SharePoint Calendar to events using the Calendar E-Mail Extension and therefore enhance these event’s with the ability to send invitations to attendees.

First of all you don’t have to create a new calendar (with e-mail extension), it’s also possible to just add the “Event (with e-mail extension)” content type to your existing SharePoint Calendar. If the “Calendar E-Mail Extension” feature is activated in the site collection features, the “Event (with e-mail extension)” should be available in the site content types. So go to the list settings of your calendar list, click on “Add from existing site content types” in the content types section (if this is not available, make sure management of content types is allowed in the advanced settings). Select the “Event (with e-mail extension)” content type, click on Add and OK. Now you can change the new button order and default content type. Make sure the Event (with e-mail extension) is the default content type.

Now you have basically enhanced your SharePoint Calendar with the E-Mail Extension functionality.

If you want to use the E-Mail Extension features with your existing events, you have to change the content type of these events. The easiest way to do this is with a simple SharePoint power shell script. Open a SharePoint power shell and paste the code below (change the web URL and the list name before you execute the script).

If you want to copy the code, hover over it and click on the view source button on the top right.

# Open web (change this url to your web url)
$web = Get-SPWeb "http://yourweb"
# Get calendar list (change the title of the list)
$list = $web.Lists["Calendar"]
# Get the Event (with email extension) content type, make sure it's available on the list
$ceeCType = $list.ContentTypes["Event (with email extension)"]
# Use SPQuery to limit the fields to retrieve
$query = New-Object Microsoft.SharePoint.SPQuery
# only ContentTypeId and ID required
$query.ViewFields = "<FieldRef Name='ContentTypeId' /><FieldRef Name='ID' />"
# get all items
ForEach($item in $list.GetItems($query))
{
    "Changing ContentType for Item with ID " + $item.ID
    # change content type
    $item["ContentTypeId"] = $ceeCType.Id
    # update the item (SystemUpdate to not create a new version or change Modified, Modified By)
    $item.SystemUpdate($false)
}
# Open web (change this url to your web url)
$web = Get-SPWeb "http://yourweb"
# Get calendar list (change the title of the list)
$list = $web.Lists["Calendar"]
# Get the Event (with email extension) content type, make sure it's available on the list
$ceeCType = $list.ContentTypes["Event (with email extension)"]
# Use SPQuery to limit the fields to retrieve
$query = New-Object Microsoft.SharePoint.SPQuery
# only ContentTypeId and ID required
$query.ViewFields = "<FieldRef Name='ContentTypeId' /><FieldRef Name='ID' />"
# get all items
ForEach($item in $list.GetItems($query))
{
    "Changing ContentType for Item with ID " + $item.ID
    # change content type
    $item["ContentTypeId"] = $ceeCType.Id
    # update the item (SystemUpdate to not create a new version or change Modified, Modified By)
    $item.SystemUpdate($false)
}

If you want to try the Calendar E-Mail Extension a fully functional 30-day trial is available on the Calendar E-Mail Extension product page.