Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stig Rune Frydenlund 6 posts 76 karma points
    May 26, 2016 @ 08:54
    Stig Rune Frydenlund
    0

    Upgrading Umbraco from v4.8 to v7

    Hi.

    I have been given the task of upgrading an existing website built with Umbraco. Needless to say, as I have not worked with Umbraco previously, there is a lot of ground to cover, but I am getting there slowly reading a lot on the forums and watching umbraco.tv :)

    To further complicate matters, the existing site is built with a very old version of Umbraco (4.8.0) using both C# and VB.NET, WebForms with master pages and alot of custom usercontrols.

    The task includes:

    • Upgrade to the latest version of Umbrco using MVC
    • Apply a responsive design to the entire Webpage
    • Restyle the page entirely
    • Preserving existing content (articles, media and so on)

    There are already some challenges:

    • Upgrading to the latest version of Umbraco introduces a need for a lot of refactoring to the existing custom libraries as there have been a lot of API changes since version 4.8.0.
    • Preserving and migrate existing data (the existing site will have to «live» while the new one is being developed, then the production data will need to be migrated somehow).
    • There are no unit tests of any kind, so refactoring the code to comply with the API changes will be a daunting task. Going for the MVC option will of course ease this task as it is easier to test.

    I have been experimenting with the existing site creating a backup version of it, and have also tried exporting the Umbraco database upgrade it, do a fresh install of the latest Umbraco on a entirely blank/new Website solution, and then attach the old upgraded database. This seems to work for the Umbraco contents (as long as all the referenced files are being re-created and adapted along the way, but will of course require a lot of work.

    As I understand, there are several ways of solving this, but I would be very interested in hearing from the community if you have been given similar tasks or have any recommendations on how to approach this in the best possible way.

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    May 26, 2016 @ 09:03
    Dennis Aaen
    1

    Hi Stig,

    Try to see this tweet from Sebastiaan, perhaps this can help you to make the upgrade process a bit easier.

    https://twitter.com/SimonAntony/status/733597014122864640

    Hope this helps,

    /Dennis

  • Stig Rune Frydenlund 6 posts 76 karma points
    May 26, 2016 @ 10:38
    Stig Rune Frydenlund
    0

    Thanks for the suggestion.. I will have a look at it..

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    May 26, 2016 @ 09:19
    Sebastiaan Janssen
    0

    It seems like you've come pretty far already.

    Obviously it's going to be up to you to re-implement the code and make it work like it should. I think the strategy I would take is:

    • Keep the 4.8 site live as it is while you're developing the v7 version
    • Periodically take the live database and upgrade it using a clean v7 installation
      • Install v7.4.3
      • Update the connection string to point to the backup of your 4.8 database
      • Change the umbracoConfigurationStatus in your web.config to 4.8.x (x being whatever version you currently have)
      • Run through the upgrade installer
      • Then when that succeeds you can point the v7 site that you're working on, now you'll have all the latest content and whatever other changes were made
    • Finally, when you and the client are happy with the v7 version you do the above database dance one more time and deploy the site + database
      • Note: while you're doing that for the last time, schedule some time for it and tell your editors they shouldn't update the site, or they'll lose changes

    Other than that, sounds like a big job, good luck! ;-)

  • Stig Rune Frydenlund 6 posts 76 karma points
    May 26, 2016 @ 10:38
    Stig Rune Frydenlund
    0

    Thanks for your tips. I thought of following that route myself. However, one of the challenges are that there will be changes to the database in development too, so I cannot replace all the contents while exporting the latest production version. Templates will have to be rewritten to use partial views in stead of macros/user controls, and as I understand, this is registered in the database for the templates. I suppose I can manually do an update of the database after migration as long as I keep track of tables and data, but it could still be a daunting task. Running a few upgrade sequences will answer if this will work.

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    May 26, 2016 @ 13:46
    Sebastiaan Janssen
    1

    Perfect!

    So here's a fun little hack: if you create a .cshtml file in ~/Views with exactly the same name as a Masterpage file, the .cshtml file will be used instead of the .master file. This was initially meant as an easy way for people to convert their master pages gradually to MVC views. So that should work out pretty well for your then :)

    If you create new templates, then you'd definitely need to keep track of them but that shouldn't be toooo much work.

  • Stig Rune Frydenlund 6 posts 76 karma points
    May 30, 2016 @ 06:53
    Stig Rune Frydenlund
    0

    Thanks a lot. That could prove to be most useful.

    Do you know if there is an easy way to use both rendering models (for both user controls and MVC views) while converting the views, or do all views need to be rewritten if MVC is to be used? That way the conversion process can be sped up as not all views will need to be rewritten at once, but only the ones requiring layout changes.

    I've read some articles stating that it should be possible to facilitate rendering user controls and facilitating events in a controller while working with MVC/Razor views, but I do not know if this will work in the Umbraco world.

Please Sign in or register to post replies

Write your reply to:

Draft