Search code examples
migrationumbraco7umbraco6

How might I migrate an umbraco 6 live site a to version 7 site in visual studio?


I have been handed the job of upgrading an intranet site because I'm in dev. The current site is running under umbraco 6 and I am told it is corrupted. I have umbraco 7 running on visual studio 2015 on my machine. I am required to migrate the site to my machine, make sure it runs, check it in, let the boss pull it and check it and finally publish it.

How may I extract the page designs, content and custom code from the (possibly) corrupt version 6 live site and import it into the version 7 site running on my machine please?


Solution

  • Firstly I'd backup the database and restore it as a new version for testing.

    Something like websitename.umbraco7.cms

    What details do you have on the database being corrupt?

    This way you can break it as many times as required until you've got it right.

    Then I'd just try upgrading the nuget package if that's an option? the upgrade from 6-7 shouldn't be a massive issue and it will perform the database upgrade. You'll need to ensure umbraco config is using Webforms rather than the default MVC razor views. see here for more info: https://our.umbraco.org/documentation/reference/templating/

    If you prefer to work with Webforms, you can change the default template engine in the /Config/umbracoSettings.config file, find this section and set the type you'd like to use (Mvc or WebForms):

    <templates>
        <defaultRenderingEngine>WebForms</defaultRenderingEngine>
    </templates>
    

    Another option is to create a new clean solution and install the latest Umbraco version you are upgrading to. Once that is installed, reset the connection string to your current site database and set the umbracoConfigurationStatus appSetting to the version you are currently on.

    <add key="umbracoConfigurationStatus" value="7.7.1" />
    

    When you build and run the website for the first time, it will recongise you have umbraco already installed and will perform the update within this solution.

    The clean umbraco install will default to using Razor templating, you may need to switch it back to webforms (see previous comment regarding this) or manually migrate the views from webforms to razor.

    I can't express enough the requirement to do this away from the production database, make a backup and run through the process as many times as required until you've got a clean build.

    If in doubt, consult the upgrade documentation: https://our.umbraco.org/documentation/getting-started/setup/upgrading/general