Copied to clipboard

Flag this post as spam?

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


  • Meni 247 posts 483 karma points
    Jan 26, 2021 @ 05:59
    Meni
    0

    Error during installation - Umbraco 7 to 8

    Hi, I try to upgrade my website from Umbraco 7 to 8. I get the following error when I run it locally (the content migration tool) , during the installation process:

    Error during installation

    The database failed to upgrade. ERROR: The database configuration failed with the following message: Cannot rename datatype alias "Umbraco.MediaPicker2" to "Umbraco.MediaPicker" because the target alias is already used.This is generally because when upgrading from a v7 to v8 site, the v7 site contains Data Types that reference old and already Obsolete Property Editors. Before upgrading to v8, any Data Types using property editors that are named with the prefix '(Obsolete)' must be migrated to the non-obsolete v7 property editors of the same type. Please check log file for additional information (can be found in '/App_Data/Logs/')

    Not sure how should I resolve it - do I need to open and edit the database? the .SDF file?

    Or just the website code? the views? scripts?

    Please advise.

    Thanks.

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jan 26, 2021 @ 07:33
    Marc Goodson
    1

    Hi Meni

    The first step would be to upgrade your v7 site to the last version of V7 (7.15.6).

    Then in the developer section of the Umbraco backoffice, find the 'Data Types' tree, and click on each 'Data Type' and see 'which property editor' the Data Type uses.

    If you have a Data Type (and it sounds like you do!) that uses an obsolete property editor, you'll see the property editor has the word obsolete in front of it's name. This will usually be for any 'content picker' type properties.

    This is because Umbraco, in the V7 series, has been slowly migrating to use a Guid key as the unique way of indentifying an Umbraco item, instead of an integer Id, and as a way to keep people's backwards compatibility - they introduced a new version of several property editors with the number '2' at the end of the name, that store the Guid keys (Udis) but left the old editors in place that store picked integers - so as not to break existing sites.

    In order to migrate to V8 you need to switch any (obsolete) Property Type to be the equivalent Property Type 2, implementation.

    see the warning on the migration advice page: https://our.umbraco.com/documentation/getting-started/setup/upgrading/migrating-to-v8

    Anyway depending on how often these obsolete pickers are used on your site depends on your strategy for switching them over.

    (If you just change them in the Umbraco backoffice, then it won't automatically update all your stored picked ids to become guid Udis :-()

    If you have just one or two usages, the pragmatic thing would be switch the property editor to use the non obsolete version, then go back into your content and 're pick' the picked items, so that the guid Udis are updated in the database, and then you can proceed with your migration....

    ... but if you have 20,000 picked items then that will be a big pain! and you'll want to automate the conversion of the stored value from an integer to a Guid Udi.

    There is a project called Machina, where KevinG has built a structure around which you can write scripts to do this kind of migration - and it contains functions that migrate the content and media pickers;

    https://github.com/kgiszewski/Machina

    But if that looks super complicated, then if you switch a Data Type to use the new Guid storing version, then it will be a case of writing some one off code (could even be in a template) that loops through descendants of your site, and for each obsolete picking property, get the stored integer ids, and use them to pull back the picked item from the Umbraco cache, and then use the ContentService to save the page again, with the stored values converted from integers to the Udis which you can read from the Umbraco cache items you've retrieved...

    https://github.com/umbraco/Umbraco-CMS/pull/6413

    fingers crossed it's just one or two you have and they can be updated manually!

    regards

    Marc

  • Meni 247 posts 483 karma points
    Jan 26, 2021 @ 21:02
    Meni
    0

    Hi Marc, thanks for your answer.

    My current website is 7.15.6

    So here's my question - this the way I did it: using Visual Studio 2017 I created a fresh umbraco 8 project and installed Umbraco 8.10.1 using NuGet.

    Then, I only copied my .SDF file to the App_Data folder of the new fresh installation of U8 and edited the web.config with my string connection and set Umbraco.Core.ConfigurationStatus to 7.15.6

    So pretty much there isn't still any views / Data Type etc. as I even didn't get to it - the installation process got stock after ~1 hour with the error message.

    So my assumption is that it's something with the .SDF file?

    Also, yes, I have thousands of posts in my website as it's a magazine ....

    Thanks

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jan 26, 2021 @ 21:55
    Marc Goodson
    0

    Hi Meni

    You need to hunt for your obsolete DataTypes with the existing V7 site first... Before you do the step to create a clean V8 solution and copy across the db.

    Regards

    Marc

  • Meni 247 posts 483 karma points
    Jan 27, 2021 @ 06:44
    Meni
    0

    Hi Marc, Thanks. I looked in the DataTypes in my existing website and I see it now - the obsolete.

    So in my current website on production I don't want to touch.

    But also, even if I was changing it - how would it affect the clean local installation of V8?

    The only thing from my 7.15.6 in the new fresh local install of V8 is the .SDF file - which to my understanding - this is the DB?

    So if it's only the DB - I assumed that I need to edit the DB or something like this?

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Jan 27, 2021 @ 07:19
    Marc Goodson
    0

    Hi Meni

    With Umbraco, the content that you save, is stored in the database along with the definition of the structure of your site.

    The database contains everything!

    If you create a new Document Type for a new type of content on your site, then the definition of that Document Type and any Data Types it uses is stored in the database.

    The Data Types specify the format for how the content should be saved.

    In your existing V7 site you have an obsolete Data Type, that is telling Umbraco to save references to 'picked' content as a list of their unique integer Ids, but the new favoured way is to use the equivalent V2 DataType that stores them in a Guid Udi format. The V8 migration process will fail if any of the Document Type have properties that use an obsolete Data Type.

    So if you install a vanilla version locally in Visual Studio of 7.15.6 and copy over your database, that would give you a step to 'play around' with your data and data structures 'pre-migration' without affecting the production live site.

    Install the Pre-Migration Healthcheck too https://our.umbraco.com/packages/developer-tools/pre-migration-health-checks/

    As I say if you have one property that uses the obsolete Data Type, then I'd manually change the Data Type for the property to the V2 version and then repick all the content using it.... but if it's hundreds you'll want to write some code in this vanilla V7 site, to loop through all the content that uses the obsolete type, and change the stored value programatically using the ContentService to be in the Udi format.

    Once you've updated the Obsolete Data Types to be the new V2 equivalents and updated all the stored values to be in the Udi format, you can then copy your database from your vanilla V7 solution, into the V8 solution to start the migration process again...

    regards

    Marc

  • Meni 247 posts 483 karma points
    Feb 02, 2021 @ 06:51
    Meni
    0

    Hi Marc, I started doing it today on my local, but then somehow now my website in unavailable! Apparently it somehow affected the production website!!

    What's going on with this CMS??? Really disappointed!! Now I can't even find the obsolote ones

    How come changing in the local affected my website?

    Thanks

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Feb 02, 2021 @ 07:18
    Marc Goodson
    100

    Hi Meni

    What is your database connection string?

    If you look in web.config - is it possible your local copy is pointing at a shared database server instead of a file?

    Working locally and updating a non-production database wouldn't affect the live site, but if your local copy is pointing to the live database then it would.

    In terms of your live site unavailability do the trace logs point to a specific issue?

    Also what was the action you took on your local machine that triggered the issue on production? If you changed an obsolete property editor to be a v2 property editor - without also changing the data, then you will be able to switch it back from V2 to obsolete, to revert the issue.

    If the Obsolete property editor isn't available to choose in the dropdown of property editors this is because there is a setting in /config/umbracosettings.config called

    <showDeprecatedPropertyEditors>true</showDeprecatedPropertyEditors>
    

    If you set to true, the obsolete property editors should appear again!

    regards

    marc

  • Meni 247 posts 483 karma points
    Feb 03, 2021 @ 06:15
    Meni
    0

    Hi Marc. First, Thank you so much - my website is back again. I was able to revert back from v2 to obsolete.

    I'm not sure about the connection string. I just copied-paste it from my web.config on the server to the local web.config when I installed locally using nuget.

    Otherwise how can I access the DB locally?

    I followed the tutorial on this website where she explains to copy the .SDF file from AppData to the local AppData. So after install locally Umbraco 7.15.6 I copied the .SDF file, then added the connection string from the web.config on the ftp to the local web.config

    How can I check in the local web.config if it's pointing to a local copy or to the live database? Again, for the local copy I just copied the .SDF file from App_Data.

    Also, is it make sense that my .SDF file is so small? I have like, maybe thousands of posts and news items on my website. So how come the DB is so small? Only 1.56MB!

    Also, a while ago I did database backup from my Azure and my .bacpac file is 65 MB

    So little confusing.

    So how can I make sure next time my web.config points to the local .SDF and that I can work safety on the local install without causing the production to be unavailable?

    Thanks

  • Marc Goodson 2141 posts 14344 karma points MVP 8x c-trib
    Feb 03, 2021 @ 22:18
    Marc Goodson
    0

    Hi Meni

    You can choose to install and run Umbraco with several different types of database implementations..

    You can point to a SQL Server instance or use SQL Azure or for small sites even SQL CE which is a local file based (. Sdf) database implementation. When you use the Umbraco Cloud hosting service then it will use a SQL CE database for 'local development environments.

    It sounds like to me that your production environment is using a SQL server implementation... Rather than the SQL CE. Sdf file...

    Your connection string will have the name of the sql server that the site connects to...

    ... I think coincidentally you have a. Sdf i. Your app data folder that is perhaps a legacy of when your site was first installed... Youll probably see the last updated date of the. Sdf file isnt very recent!

    It sounds like you may be following a tutorial designed for a site hosted on umbrsco cloud which doesnt match your setup.

    Your next step is to find your database server environment... From the connection string...

    And take a copy of your database in that environment..

    And update the connection string to point at this copy... So you can safely begin thr switching of the obsolete editors...

    Regards

    Marc

Please Sign in or register to post replies

Write your reply to:

Draft