Upgrading Kentico 12 manually

Upgrading Kentico manually

Note: We strongly recommend using the automatic upgrade described in Upgrading to Kentico 12.

If you already have Kentico 12 and wish to apply Kentico 12 Service Pack, you only need to apply hotfix version 12.0.29 or newer to your project. See the Hotfix instructions to learn how to install the service pack via the hotfix.

If necessary, you can perform the upgrade from version 11 to 12 manually.

Installing the upgrade procedure

  1. Download the Kentico 12 upgrade.
  2. Run Upgrade_11_0_12_0.exe.
  3. Install the upgrade procedure (the installer places the upgrade into the C:\Program Files\Kentico\12.0\Upgrade110_120 folder by default).

 

Preparing your project for the upgrade

  1. Set up a local copy of your Kentico 11 web project.
  2. Go through the required Steps before the upgrade.

 

Creating the project files

The recommended way to create an upgraded project is to start with a new clean installation of Kentico 12 and then transfer custom file content from your original project.

 

根据这个手动升级,写自动升级

1.需要删除的文件SourceItemsToRemove,在Kentico\12.0\Upgrade110_120\upgrade.xml文件中列出来了

2.需要执行的数据库脚本,Kentico\12.0\Upgrade110_120\SQL\upgrade.sql

3.升级的流程,参考Kentico\12.0\Upgrade110_120\CMS\CMS\Old_App_Code\CMS\UpgradeProcedure.cs和Kentico\12.0\Upgrade110_120\CMS_PROJ\CMS\App_Code\CMS\UpgradeProcedure.cs,这两份文件是同一个。

 

导出xml中待删除的文件

  [Test]
        public void Test20210427001()
        {
            var folder = @"C:\workspace\Kentico\12.0\Upgrade110_120\";
            string path =Path.Combine(folder,"upgrade.xml");
            var rootElement = XElement.Load(path); //UpgradeItemsList node
            var temp = rootElement.Element("SourceItemsToRemove");
            StringBuilder stringBuilder = new StringBuilder();
            foreach (var item in temp.Elements())
            {
                var value = item.Value;
                value = value.Replace("<string>", string.Empty);
                value = value.Replace("<string>", string.Empty);
                //Console.WriteLine(value);
                stringBuilder.AppendLine(value);
            }

            string outputPath = Path.Combine(folder, "DeleteFiles.txt");
            File.WriteAllText(outputPath,stringBuilder.ToString());
        }

 

posted @ 2021-04-21 15:32  ChuckLu  阅读(58)  评论(0)    收藏  举报