How To Upgrade Sitecore 7.2 To Sitecore 7.5
Sitecore upgrades can be a tiresome process compared to some other CMS systems. A NuGet package update can be a lot easier than the mammoth task that can face some Sitecore developers with the prospect of upgrading Sitecore. A lot of the community has their own views and opinions about which approach can be defined as 'best' practice. As with human beings, every project is different and there definitely isn't a one size fits all solution. In today's guide, I'm going to cover the process I used to upgrade a website from Sitecore 7.2 to Sitecore 7.5.
Getting Start TipsWhen I did the upgrade I ran into a lot of issues, this generally meant that I needed to revert what I did and start from scratch several times. The recommended approach by many to architect a Sitecore solution is to use the clean Sitecore instance approach and publish all your changes into it, as discussed here: How To Architect Your Sitecore Website With MVC. If you are using this approach, I recommend having a Zip file of the 7.2 clean instance to rollback to in a ZIP file and a 7.5 clean instance in a zip file. If things do go wrong, being able to compare config files and rollback quickly will save you a lot of time.
Installation FilesThe first thing you will need is the correct files. As with any Sitecore upgrade, it is recommended to take an incremental approach and always upgrade to the first base version (in this case 'Sitecore®Experience Platform™ 7.5 rev.141003'). The files you will need are:
- Sitecore Web Application Installer
- Sitecore 7.5 Update Package
Back-upThis goes without question. Before you start any form of upgrade, make sure you can roll back and start from scratch if things go awry. Always take a copy of your webroot and code files (that's what source controls for) and your Analytics, Core, Master and Web database.
Run The SQL ScriptsThe first you will need to do is unzip the upgradecms75_sql and run the included SQL script, UpgradeCMS75.sql' against your websites Core, Master, Analytics and Web databases.
Disable Certain Config Values For Installation OnlyIf you do not do this, then the upgrade process will throw a wobbly and fail. Add a '.disabled' extension to the following files:
Prerequisites / IssuesI thought I would include the issue I came across before you ran through the installation to try and help you prep as much as possible. On my first upgrade I had a lot of issues. The first thing that caused me some pain was having the latest version of certain key assemblies in my bin directly. I use Nuget in my projects and as a result of adding certain packages, some key assemblies had been upgraded too far. When the installer ran, I ran into a lot of version mismatch exceptions. Trying to do the binding redirects didn't work as the site will need to run on one version, downgrade an assembly without updating the binding redirect in the web.config as it progresses and consequently throw an exception during installation due to a version conflict. To make sure everything worked, I needed to ensure I was using the following versions (also check that every project in your solution is using the same version!
- Json.Net needs to use version 18.104.22.168
- HTMLAgility pack needs to use 1.4.6
- HTMLAgility pack needs to use 1.4.6
- Microsoft.AspNet.WebApi.Core needs to use 5.1.2
<add name="analytics" connectionString="mongodb://localhost/analytics" /> <add name="tracking.live" connectionString="mongodb://localhost/tracking_live" /> <add name="tracking.history" connectionString="mongodb://localhost/tracking_history" />I tried running the upgrade process again and got this error (SO DO NOT TRY TO DO THIS AT HOME). The contacts repository settings relate to the new xDB stuff which makes sense and should be in your Sitecore.Analytics.config. As the update wizard is failing before it can upgrade your config files, the error makes sense. To get around this you need to make sure you have Sitecore.Analytics.config and Sitecore.Analytics.ExcludeRobots.config in your 'App_Config' -> 'Include' folder with a disabled extension, like so: Sitecore.Analytics.config.disabled Sitecore.Analytics.ExcludeRobots.config.disabled In Sitecore.Analytics.config, you should also make sure 'Analytics.Enabled' is set to 'False'. After this I then ran into this error: 'Could not resolve type name: Sitecore.Pipelines.HttpRequest.OverrideDialogs, Sitecore.Speak.Client (method: Sitecore.Configuration.Factory.CreateFromTypeName(XmlNode configNode, String parameters, Boolean assert)).' To get past this error you need to make sure that you have Sitecore.Speak.config in your 'App_Config' -> 'Include' folder with a disabled extension, like so: Sitecore.Speak.config.disabled If you have any custom modules installed then you may have to follow a similar process of adding the disabled extension to each modules config file. After running the installation wizard, I also encountered this error: "Could not resolve type name: Sitecore.ContentSearch.Events.PublishingEventHandler" This was an issue with the Lucene search the site in question was using and is related to 'Sitecore.ContentSearch.config'. To fix the issue I copied the 7.5 version into 'App_Config' -> 'Include' overriding my existing file. I then added the .disabled extension to the end. I also copied the 7.5 version (22.214.171.12430) into my webroot and re-ran the upgrade wizard
Run The Update Installation WizardTo open the 'Update Installation Wizard' in a web browser by adding '/sitecore/admin/UpdateInstallationWizard.aspx' after your website name (make sure that you are logged in):
http://local.website.com/sitecore/admin/UpdateInstallationWizard.aspxThis should load the Upgrade Wizard. Click 'Next' and select upload the update package. Give the review screen a quick once over and click the 'Analyze and install the package ->' button. I would recommend choosing 'Analyze' before installation to see if you have any potential issues upgrading, so click the 'Analyze' button. Download the analysis to excel if you want to and press the 'Install the package' button. If everything goes to plan the installer should complete successfully. I would also recommend making a ZIP file backup of your new semi-upgraded webroot. When we start to add the new config files and assemblies back into your visual studio code solution and re-publish changes later, you do not want to accidently override any files etc..
Install The Reposting DatabaseI think when most people think of upgrading to Sitecore 7.5+ everyone always thinks Mongo. The Sitecore Experience Database (xDB) uses two database systems, SQL and Mongo to store the analyitics data. SQL is used to store aggregated reporting data, Mongo is used to store real-time experience data. When you upgrade you won't have a copy of the reporting database. To get around this I installed a fresh install of 7.5 and copied the analytics database from the 'Database' folder You need to install two copies of the reporting database. So, in the database directory for your upgraded website, make two copies of the 7.5 analytics MDF and LDF and attach them in SQL. In your 'App_Config' folder, open up your ConnectionStrings.config and create two new connection string properties, reporting and reporting. The reporting secondary database is when Sitecore transfers live and historical data when rebuilding the reporting database. Your web.config should now look something like this:
<?xml version="1.0" encoding="utf-8"?> <connectionStrings> <?xml version="1.0" encoding="utf-8"?> <connectionStrings> <!-- Sitecore connection strings. All database connections for Sitecore are configured here. --> <add name="core" connectionString="user id=;password=;Data Source=(local)\SQLEXPRESS;Database=Sitecore75Sitecore_Core"/> <add name="master" connectionString="user id=;password=;Data Source=(local)\SQLEXPRESS;Database=Sitecore75Sitecore_Master"/> <add name="web" connectionString="user id=;password=;Data Source=(local)\SQLEXPRESS;Database=Sitecore75Sitecore_Web"/> <add name="analytics" connectionString="mongodb://localhost/analytics"/> <add name="tracking.live" connectionString="mongodb://localhost/tracking_live"/> <add name="tracking.history" connectionString="mongodb://localhost/tracking_history"/> <add name="reporting" connectionString="user id=;password=;Data Source=(local)\SQLEXPRESS;Database=Sitecore75Sitecore_Analytics"/> <add name="reporting.secondary " connectionString="user id=;password=;Data Source=UKPC0067\SQLEXPRESS;Database=Sitecore_AnalyticsSecondry" /> </connectionStrings>
Updating Configuration FilesRe-enable Enable Sitecore.Speak.config by removing the .disabled extension. In the project I upgraded, I didn't need to worry about keep any existing analytics data or settings. If you are in a similar position, make sure you have a backup copy of your Sitecore.Analytics.config.disabled Sitecore.Analytics.ExcludeRobots.config.disabled, delete them. As part of the upgrade process, Sitecore should have created you two new analytics config files if not, then copy over the Analytics configs from your fresh install. Double check the 'connectionstring.config' looks ok. You need the follow analytics connection settings
<add name="analytics" connectionString="mongodb://localhost/analytics" /> <add name="tracking.live" connectionString="mongodb://localhost/tracking_live" /> <add name="tracking.history" connectionString="mongodb://localhost/tracking_history" />IMPORTANT Head over to Sitecore and have a look at Configuration File Changes between Sitecore CMS 7 Releases. In here is a list of configuration changes you will need to make, depending on the upgrade path you have taken. Go through and make sure you have upgraded everything. The other option is to override your existing files, and then you beyond compare to see where the differences exist and make sure you copy the new changes in successfully. If you use the content search then I would strongly recommend you read up on some of the potential pitfalls that you will encounter along the way. Upgrading Sitecore Content Search-7-2-to-7-5/