Tool to assist during upgrade of EPiServer CMS
EPiServer Deployment Center is used to upgrade from one EPiServer CMS version to another. It copies new files to your www root folder, it changes configuration files, it upgrades the database schema and finally executes some tasks by starting an application domain using the configuration files and binaries in your www root and executing them in this context.
I think this last step is the most common cause of problems when upgrading an EPiServer CMS solution in production. Maybe you can not start the site between after you have upgraded to from 5R2 to 6R2 because you have compiled you new version for 6R2 (or maybe even 7)?
Completed with errors – Missing XForms and other issues
You might get an error in the upgrade log indicating that Upgrade-EPiXForms or Upgrade-EPiXFormNames failed. Or maybe your team decided to upgrade the EPiserver CMS database just by using the SQL update scripts and later your find out that all XForms are missing. These are two examples when the last step in the upgrade process failed or was not executed.
It can take 4 hours to upgrade XForms if you have around a million XForm posts stored in the database.
A Tool to manually execute upgrade tasks FOR EPiServer CMS
![clip_image002[5] clip_image002[5]](http://blog.fredrikhaglund.se/wp-content/uploads/2012/12/clip_image0025.jpg)
Paul Smith has blogged about one workaround to Upgrade-EPiXFormNames. It solves the problem by executing the same code inside your web site instead of relying on EPiServer Deployment Center to do it.
I have extracted all of these special tasks that are executed inside the context of the web application in EPiServer Deployment Center into a plugin so you can execute the steps later much easier.
Using this plugin enables you to:
- Complete the upgrade of XForms later so you do not have to wait for hours on EPiServer Deployment Center if you have many forms.
- Upgrade directly from EPiServer 5 R2 to EPiServer 6 R2 (possibly also EPiServer CMS 7) without compiling for EPiServer CMS 6 R1.
- Upgrade a production database without using EPiServer Deployment Center.
Upgrading EPISERVER database without using deployment center
Follow these steps if you want to upgrade a database directly form EPiServer CMS 5 R2 to EPiServer CMS 6 R2 Hotfix 2!
- Verify that EPiServer Deployment Center for EPiServer 5R2, 6R1 and 6R2 is installed on each production webserver. (This is needed to get all assemblies installed in the GAC and get the latest EPiServer services.)
- Double check that it is EPiServer 6 R2 with Hotfix 2 that you have installed if it is already present on the server. The version number of EPiServer.dll in C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\bin should be 6.1.379.502.
- Upgrade the production database from EPiServer 5R2 to 6R2 Hotfix 2 by running the following SQL scripts for EPiServer CMS and EPiServer Framework in correct order.
You will find the scripts in the following three folders:
C:\Program Files (x86)\EPiServer\Framework\6.2.267.1\Database\sql
C:\Program Files (x86)\EPiServer\CMS\6.1.379.0\Upgrade\Database\sql
C:\Program Files (x86)\EPiServer\Framework\6.2.267.1\Upgrade\Database\sql - Update the web application
- Make sure the site has EPiServer.dll version 6.1.379.502
- Verify that your new configuration files from your build server are updated with correct assembly bindings to this version
- Verify that your Connection String points to the upgraded database
- Finally, verify that the web application starts!
- Drop the file Avantime.Upgrade5To6Tool.dll in the bin folder of the upgraded site. [DOWNLOAD HERE]
- Go to Admin Mode
- Click Config > EPiServer Upgrade Tool
- Run each of the jobs.
- Each job is executed on a separate thread so refresh the log to see the progress.
- It is normal that some xform upgrades fails. You can rerun the XForm upgrade several times if it is aborted.
- Disable logging if you have a lot of data. The log is stored in memory.
- Remove Avantime.Upgrade5To6Tool.dll when finished.



Excellent!
I did a small tool to check for a a couple of possible errors that will cause errors in the xform migration process. Can be a good idea to run it first.
http://world.episerver.com/Blogs/Per-Nergard/Dates/2012/9/CMS5-to-CMS6-upgrade-XForm-validation/
Nice one!
Do you also have the list, order and location of the scripts to run to manually upgrade the database from EPiServer 5 R1 SP3 to EPiServer 5 R2 so I can then follow the list above?
You can see the path to the locations of the db script folders below the image with all SQL scripts. Grab them from these locations. You can see the order on the image.
Yes but doesn’t that assume the database is already at CMS 5 R2 or do I not need to worry about upgrading from R1 SP3 as the first script will sort the database out?
Yes, it does assume that you are on EPiServer CMS 5 R2.
Just Exec sp_DatabaseVersion on you EPiServer database to see what version the database is currently on. Use this information to decide what files needs to be executed. Just manually check the if-statement at the top of the SQL files that are used for upgrade to see if it should be executed or not.
Notice that things get more complicated from EPiServer 6 and forward since the product is split into to products (Framework and CMS).
Thanks for the tips, here is the list of scripts I ran to upgrade the database from EPiServer CMS 5 R1 SP3 to EPiServer CMS 6 R2 HF 2:
!1_0005_0001_0422_0252to0005_0002_0080_0097.sql
!2_0005_0002_0080_0097to0005_0002_0080_0190.sql
!3_0005_0002_0375_0007to0005_0002_0375_0116.sql
!4_0005_0002_0375_0116to0005_0002_0375_0140.sql
!5_0005_0002_0375_0140to0005_0002_0375_0220.sql
!6_0005_0002_0375_0220to0005_0002_0375_0229.sql
0_EPiServer.Data.sql
1_0005_0002_0375_0236to0006_0000_0431_0001.sql
2_0006_0000_0431_0001to0006_0000_0460_0000.sql
3_0006_0000_0461_0000to0006_0000_0493_0000.sql
3a_0006_0000_0318_0113to0006_0002_0127_0000.sql
3b_0006_0002_0128_0000to0006_0002_0130_0000.sql
3e_0006_0002_0229_0000to0006_0002_0256_0000.sql
4_0006_0000_0494_0000to0006_0000_0534_0000.sql
5_0006_0000_0535_0000to0006_0001_0233_0000.sql
6_0006_0000_0612_0000to0006_0000_0829_0000.sql
7_0006_0001_0234_0000to0006_0001_0236_0001.sql
8_0006_0001_0237_0000to0006_0001_0287_0000.sql
9_0006_0001_0288_0000to0006_0001_0316_0000.sql
Note: When I ran scripts 3C and 3D from the original list they errored and on closer examination I found that what they were trying to do had already been done by earlier scripts so I ignored them.
Next issue….
I downloaded the Avantime.Upgrade5To6Tool.dll and dropped it into the bin folder of the upgraded site but when I click on any of the functions inside Admin Mode I just get a message on the screen that says something like “09:50 Avantime.Upgrade5To6Tool.UpgradeTools: Starting execution of ConvertLongStringSettings.” but then nothing else happens, any ideas?
Great article, and it’s just what I need. However I am having trouble converting xforms. Would it be possible to open source the upgrade tool plugin? I need to add some better logging, now it’s just “An error occured…”
Hi Ulrik!
Yes, I did consider that but I have not yet since I have borrowed some code from EPiServer’s installer by reverse engineering it. I will check if someone at EPiServer will give me their blessing…
Meanwhile, send me an email and I will share the code with you.