Where do Custom Channel Properties go while migrating a MCMS site to MOSS?
Where do Custom Channel Properties go while migrating MCMS site to MOSS 2007?
I am not sure if it’s a widely known fact among those who know about MCMS to MOSS migration more than I do.
But still, for self-appeasement I will post what I found
I created two properties (one Text and another Selection) in the ‘About Us’ channel of a default WoodGrooveNet installation :
After migrating it to MOSS, both these properties will be available in the Property Bag of the Site :
I tested below code to extract all of the properties. Do note that I used SPWeb.AllProperties (https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.allproperties.aspx) and not SPWeb.Properties(https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spweb.properties.aspx)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Text;
using System.Collections;
using Microsoft.SharePoint.Publishing;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Utilities;
namespace IterateCustomChannelProps
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("--- Enter Site Collection Url----");
SPSite oSite = new SPSite(Console.ReadLine());
foreach(SPWeb oWeb in oSite.AllWebs)
{
Console.WriteLine("---------------------------");
Console.WriteLine(oWeb.Url);
Console.WriteLine("---------------------------");
Hashtable oTbl = oWeb.AllProperties;
foreach(string key in oTbl.Keys)
{
Console.WriteLine("Key : " + key + "--Value :" + oTbl[key].ToString());
}
}
Console.WriteLine("Enter any Key to Exit");
Console.ReadLine();
}
}
}
Here they all are :
SPWeb.Properties only returns property of type ‘Selection’ and not of type ‘Text’. Well, not sure why? but a blanket explanation could be that Properties (which is a SPPropertyBag) actually returns a subset of AllProperties. (which is a hashtable).
I also noted that SPWeb.Properties doesn’t support case-sensitive keys – that and the reason above makes AllProperties a better place to store custom properties meant to be utilised in code, such as FeatureRecievers,Webparts, EventHandlers etc.
BTW, One can also check these properties through SharePoint Designer. When you open the site in SPD, SPWeb properties are available at Site -> Site Settings - Parameters tab .
Hope someone finds the info useful