Rolling back customizations

Feb 13, 2008 at 7:47 PM
I like this tool, but I'm concerned that customizations made after the tool is activated would be lost on deactivation. I think it would be better if instead of reapplying the configurations that were in place before the tool was activated, you iterate through the current AppSettingsContainer from LoadExistingAppSettingsFromSPSite and check each setting against the original deployed configuration on this tool.

  • If the current node in AppSettingsContainer is configured the same as the node in the AppSettingsModifier.XMLCONFIGFILE then apply the configuration from the corresponding node in AppSettingsModifier.XMLRETRACTCONFIGFILE.
  • Else, it would seem that the setting has changed from when you first activated this solution. This case should be examined to see if the configuration change is a result of a lack of change management process, and needs to be added into this solution as a standard configuration, or it's extraneous and can be removed.

I bet if you deactived this feature a long time after it was first deployed, because it applies the original configuration on SharePoint, you'd find yourself restoring from the most recent backup. ;^)

Regards,
Mike Sharp


Feb 15, 2008 at 10:07 PM
The only thing tool will actually "pull out" is the master page. Other settings are left in place, and can be turned off using a "false" parameter. For example you can deploy audit setting (turn checkbox to "checked") and then pull the feature out. The checkbox will stay turned on. To set it to "off" position you would have to deploy solution again with that parameter explicitly identified as "false".
Feb 28, 2008 at 10:20 PM
Can you give the flow for the master page one? Like what happens? It pushes it and yanks it or sets it back to the previous?
Feb 29, 2008 at 5:17 PM


joelo wrote:
Can you give the flow for the master page one? Like what happens? It pushes it and yanks it or sets it back to the previous?


It appears to me that it runs through each masterPage in the AppSettings file, and resets the custom and default masters it to the default master page.


foreach (ApplyMasterPage masterPage in AppSettings.ApplyMasterPages)
{
switch (masterPage.MasterPageType)
{
case MasterPageType.SystemMasterPage:

web.CustomMasterUrl = "/_catalogs/masterpage/default.master";
break;

case MasterPageType.RegularMasterPage:
web.MasterUrl = "/_catalogs/masterpage/default.master";
break;
}
}


I would have thought it would reset to the one that was saved in the backup settings file:


foreach (ApplyMasterPage masterPage in AppSettings.ApplyMasterPages)
{
ApplyMasterPage masterPageForRetract = new ApplyMasterPage();
switch (masterPage.MasterPageType)
{
case MasterPageType.RegularMasterPage:
masterPageForRetract.Name = web.MasterUrl;
masterPageForRetract.MasterPageType = MasterPageType.RegularMasterPage;
break;

case MasterPageType.SystemMasterPage:
masterPageForRetract.Name = web.CustomMasterUrl;
masterPageForRetract.MasterPageType = MasterPageType.SystemMasterPage;
break;
}
ApplyMasterPages.Add(masterPageForRetract);
}


Maybe I'm missing something here?

Regards,
Mike Sharp