Hi,
The purpose of the Upgrade method is, let's say that you have some custom logic in Install. Later you release a new version of your module, and in the new version you add more custom logic. In this case, the Upgrade method should hold the new custom logic in order to introduce it to the module when upgrading. The Upgrade method is triggered right after the upgrade of the database scheme. In this method you can do anything you usually do in Install.
Here is an example of how the Upgrade method can be used,
/// <summary>
/// Upgrades this module from the specified version.
/// </summary>
/// <param name="initializer">The Site Initializer. A helper class for installing Sitefinity modules.</param>
/// <param name="upgradeFrom">The version this module us upgrading from.</param>
public override void Upgrade(SiteInitializer initializer, Version upgradeFrom)
{
if (upgradeFrom.Build < 1100)
{
var suppress = initializer.PageManager.Provider.SuppressSecurityChecks;
initializer.PageManager.Provider.SuppressSecurityChecks = true;
var groupPage = initializer.PageManager.GetPageNode(ContentModule.ContentPageGroupId);
if (groupPage != null)
{
groupPage.Title = Res.Get(ResourceClassId, "PageGroupNodeTitle");
groupPage.UrlName = Res.Get(ResourceClassId, "PageGroupNodeTitle");
groupPage.Description = Res.Get(ResourceClassId, "PageGroupNodeDescription");
}
var landingPage = initializer.PageManager.GetPageNode(ContentModule.HomePageId);
if (landingPage != null)
{
landingPage.UrlName = Res.Get<PageResources>().ContentBlocksUrlName;
landingPage.Page.HtmlTitle = Res.Get<PageResources>().ContentBlocksHtmlTitle;
landingPage.Description = Res.Get<PageResources>().ContentBlocksDescription;
}
initializer.PageManager.Provider.SuppressSecurityChecks = suppress;
}
}
Hope this helps.
Kind regards,
George
the Telerik team