5

On our Sitecore 9.0.x environments we have a file at Website\App_Config\Include\Sitecore.Upgrade82.config with the following contents.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
   <sitecore>
     <services>
       <register serviceType="Sitecore.Abstractions.BaseFactory, Sitecore.Kernel" implementationType="Sitecore.Upgrade82.Configuration.BackwardCompatibleFactory, Sitecore.Upgrade82" lifetime="Singleton"/>
     </services>
   </sitecore>
</configuration>

Is there any reason to keep this file after upgrading to Sitecore 9.x? If not, is there anything else related to this file that can also be removed?

7

I have had that config after an upgrade as well - and you should have a Sitecore.Upgrade82 dll in your bin folder that comes with it.

So if you delete the config, you can delete that dll as well.

But can you delete it? Well, it depends I think. I did and everything was still working but I also used a clean config set from a 9 setup. I decompiled the Upgrade82 dll and it appears to handle config changes. It's main piece of code is

if (xmlAttribute2 != null && xmlAttribute2.Value.StartsWith("Sitecore.Data.Database"))
  xmlAttribute2.Value = xmlAttribute2.Value.Replace("Sitecore.Data.Database", "Sitecore.Data.DefaultDatabase");

called on attibutes "type".

I checked an old 8.1 solution and there you will find the database configs like this:

<database id="core" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">

In 8.2 and up you will find:

<database id="core" singleInstance="true" type="Sitecore.Data.DefaultDatabase, Sitecore.Kernel">

So I guess the code is make the old config still work.

My conclusion: check your config and if you don't have the Sitecore.Data.Database as a type you should be able to delete the config and the dll. That's what I did and it still works..

1

I've never seen neither Sitecore.Upgrade82.config nor Sitecore.Upgrade82.dll. Isn't it something custom built for your website?

How to check if it's still needed?

  1. Check your code repository when this config file was added. There should some descriptive commit message explaining why this config was added. Unless you're unlucky and whoever added the config didn't bother with explaining why.
  2. The config mentions Sitecore.Upgrade82 assembly. Most probably there will be Sitecore.Upgrade82.dll in bin folder. Decompile the dll and check what is its responsibility. Check if your site would still work without the config and that dll.

What else may be removed?

If the answer to the point 2 above is yes, you can definitely remove the Sitecore.Upgrade82.dll file as well. Most probably those are the only 2 things which should be removed, but ideally check your source repository for other things included in the same commit.

  • 2
    The config does not come from custom code - it is a Sitecore one that is added during upgades (depends on the original version). – Gatogordo Dec 27 '18 at 14:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.