In this article, I discuss my recent experience of upgrading this website from Umbraco 7 to Umbraco 8. I resisted upgrading to Umbraco 8 for a long time as I knew it was going to be painful, which it definitely was. In the end, it took me 10 solid days to upgrade my site!!! For those of you who have little experience upgrading Umbraco, some of the upgrade paths like from version 6 to 7 could be very easy and quick. In Umbraco 8, a lot has changed. New API's have been introduced, Umbraco has moved to more SOLID API's which is great. In terms of upgrading though it means that lot changed. If you need to upgrade your website, and you want to ease the pain of upgrading, then read on!
You might be tempted to skip the pre-requisites but DON'T. I did and it ended up costing me a day worth of dev effort. Before upgrading, you need to:
- Ensure you have visual studio 2017, upgraded to 15.9.6 - This wasted a lot of time :(
- Ensure .NET 4.7.2 is installed
- Upgrade to the latest version of Umbraco 7.15 first
The Upgrade Process From Umbraco 7 To 8
The upgrade process can be boiled down into these steps:
- Upgrade The NuGet Packages
- Run Umbraco Installation Wizard To Upgrade The Database
- Fix your code
Upgrade The NuGet Packages
I thought this step would be easy but it took me over half of a day. My main tip to make this step as easy as possible is to follow the prerequisite. If you do not have the correct version of Visual Studio, the correct version of .NET installed and applied to all your projects the packages will fail to install. When I tried to upgrade the Umbraco Nuget package, I got this error
If you get this first, double-check that all class libraries and projects are set to use .NET 4.7.2. Right-click on each solution, properties. After doing that, go into Nuget, make sure you update the umbracoCMS, UmbracoCore and Umbraco.ModelsBuilder gets upgraded on all class libraries you have within your solution. If you upgrade and have references to a different version of Umbraco the upgrade will not work.
TIP When upgrading I had some strange caching issues where it looks like my packages had been updated. I recommend that after you upgrade the core Umbraco packages you clear the NuGet cache. You can do this, by:
Run Umbraco Installation Wizard To Upgrade The Database
After upgrading the Nuget packages to the v8 versions all hell broken loose! At this stage in the upgrade process, all you really want to do is run the installation wizard to upgrade your website to v8. To do this, you need the website to compile. When I tried to compile the site after upgrading the site, I had over 6000 errors :(
After spending nearly a day, the end result was I had to comment out every single line of code in my solution in order to get the Umbraco installer.
After commenting out the code and trying to run the upgrade, it failed. As mentioned above I did not read any prereqs so I tried to upgrade, from 7.4 to 8.1. This is not a viable upgrade path. You need to upgrade the site to 7.15 working first. Do you forget to do this, as it meant I had to revert the day's worth of upgrade effort, to get my site into its original state? Upgrade the site to 7.15. Then start the process all over again. Not fun :(
WARNING After upgrading to V7.15 you may be tempted to carry on with the v8 upgrade... don't. As part of the upgrade, some of my data-types had been updated and became obsolete. If you log-into the editor and click through all the data-types within the type dropdown if you see anything with (obsolete) within the name, you will need to change these otherwise the v8 upgrade wizard will fail.
This step was really frustrating, as it caught me out twice. Each time the upgrade wizard failed due to obsolete properties, I had to revert all my packages to 7.15, open Umbraco, check the type manually. It should have been much better when I upgraded to 7.15 that I had a warning these needed to be fixed. This step probably wasted a few hours, so my advice is to triple check when you do this.
As part of this rollback issue, another issue encountered along the way was that when reapplying the Nuget UmbracoCMS package my web.config got overridden with a blank one. Two things that you should check are:
Somehow when the
UmbracoCMS Nuget pack ran then the
Umbraco.Core.ConfigurationStatus setting within the web.config was overridden with a blank value. This meant the CMS failed to load. To fix the error within the web.config I had to update this value:
If you upgrade from 7, ensure that the
uselegacy property on the membership provider has not changed. If you use older Umbraco the way passwords are encrypted changed, so if you try to log-in and fail, this is a likely cause,