After upgrading multiple Sitecore solutions, I noticed there are whole a lot of awfully slow tasks that can be automate. Hence, Sitecore Upgrade Assist is created to simplify important tasks including:
The above tasks took me long hours to complete as I had to first discover what version of the Nuget package matches Sitecore and secondly go through each package one by one and upgrade them. I don’t think anyone should go through that pain again. Sitecore Upgrade Assist is an open source Visual Studio Extension for a better Sitecore upgrade experience.
The Sitecore Upgrade Assist is a toolbox every developer needs to upgrade a Sitecore solution. For starter, it consolidates all the Nuget package required for a Sitecore Version in a modifiable xml file.
This config file is what I have used to upgrade a Sitecore solution to version 9.3.0 and can be extended to update any common packages specific to your solution. These config files are stored in Visual Studio Extension folder for now and in Later versions, I will move them to a more accessible location.
This feature is originally provided by TargetFrameworkMigrator and it is the first step for a Sitecore upgrade. To use this feature simply select all projects and click on Upgrade Framework. Note that the projects will not be automatically saved after upgrade. You should save all and build the project after this step. If everything is good and the build is successful, commit changes and move on the next step.
This feature uses NuGet.VisualStudio to upgrade all the necessary Nuget packages including Sitecore, Microsoft and other dependencies. It will first get the list of installed packages within the selected projects, check if the config file has specified a new version for the package ID and then install the given version. If the package does not have an equivalent within the config file, it will reinstall the same version for the new .NetFramework.
Since most of the Sitecore packages depend on MS packages, the tool starts first with them. Note that for this step, you must have a Nuget source named nuget.org in your solution and it must be enabled. Additionally, the installation is done with ignore dependency option to speedup the process and avoid conflicts.
After upgrading the MS packages, the tool moves on to upgrading Sitecore Nuget packages. They are detected by their prefix. Every package starting with Sitecore. will be considered and the corresponding version is set in SitecorePkgVersion node within the config file.
The package source used for Sitecore packages should be named Sitecore or Sitecore V2 and be enabled.
The tool is smart enough to understand that Sitecore packages before 9.1.0 had .NoReference suffix added to them. It will remove that package and install the equivalent for the new version.
The final step for this feature is to upgrade all other packages except GlassMapper. This is where dependencies like Newtonsoft.Json, xunit, or System.xx are upgraded. Additionally, if you add any of your custom packages to the config file, it will be also updated here.
Once you have executed this feature on all your projects, you should certainly clean and rebuild the solution. This is where all the incompatible code surface and you will be spending a lot of time resolving those. This tool thrives to provide more assistance for this step.
The final step is to upgrade Glass Mapper if you are using it. I have separated this step as it can raise several errors during the build specially if you are upgrading from v4 to v5. For this step, the tool will prompt for the current package version. The version is what you see in the glass package id as highlighted in the screenshot below.
If there is no version within the package id, select the first combobox option “Empty” and press ok.
The tool will use the selected version ID to identify and match the glass version and install the right package.
I have made the tool accessible in github and It would be great if you guys could help out for the development and adding more features. Any suggestions and feedbacks are also welcome. May the force be with you during the upgrade.