Copied to clipboard

Flag this post as spam?

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


  • Ben Norman 167 posts 276 karma points
    Mar 14, 2019 @ 22:16
    Ben Norman
    0

    Upgrade from v7 to v8

    There is a major change in the databases when moving from v7 to v8.

    The migrations fail to complete the conversion of the databases for at the moment.

    I have concluded that at the moment the code will only make a new database and not be able to migrate a database.

    Is that correct?

    Should I be waiting for v8.0.1?

    Should I be trying something different?

    Has anyone upgraded an MSSQL Database yet?

    Here is why I think that:

    The tables seem to be being updated from having a prefix of cms to umbraco. For example cmsPropertyData to umbracoPropertyData and cmsContentType to umbracoContentType.

    I cannot find the code that changes the cmsContentType table to umbracoContentType and have a couple of spots that execute sql statements that work on sqlce and not on mssql.

    I'm not sure how to proceed but I have been building a sql script that gets me through but i think i a must be missing something or this is just not yet complete. I still have a bunch of cms prefixed tables and the migration is trying to update the umbraco tables.

    Create a new working v8.0.0 site on a new mssql 2014 db.

    Checkout UmbracoCms repo at tag release-8.0.0 and update VariantsMigration.cs on line 52 by removing the word COLUMN from the sql statement as shown below SQL Command that needed to be updated

    Compile UmbracoCms repo.

    Copy Umbraco.Core dll over to the new v8 running site.

    Restore a copy of a working and fully populated 7.13.1 db over the newly created v8.0.0 db

    Update the cms version in the web.config to 7.13.1

    delete the log file

    reset iis

    run the upgrade by visiting the v8 site

    I have had to recompile v8 Umbraco.Core to fix up some of the SQLCE commands to be more MSSQL.

    Below is the sql statement that I have to run to reset the database which includes removing the audit trail but removes a couple of constraints which fail along the way. I have removed the password update so make sure you replace the password hash with your own.

    USE [master]
    ALTER DATABASE [inspirecmsv8] SET SINGLE_USER WITH ROLLBACK IMMEDIATE
    RESTORE DATABASE [inspirecmsv8] FROM  DISK = N'C:\Database\SQL2014DEV\Backup\inspirecms (6)\inspirecms.bak' WITH  FILE = 1,  MOVE N'inspirecms_data' TO N'C:\Database\SQL2014DEV\Data\inspirecmsv8_data.mdf',  MOVE N'inspirecms_log' TO N'C:\Database\SQL2014DEV\Data\inspirecmsv8_log.ldf',  NOUNLOAD,  REPLACE,  STATS = 5
    ALTER DATABASE [inspirecmsv8] SET MULTI_USER
    
    GO
    
    
    USE [inspirecmsv8]
    GO
    
    UPDATE [dbo].[umbracoUser]
       SET [userDisabled] = 0
          ,[userNoConsole] = 0
          ,[userPassword] = '## Hashed Password ##'
     WHERE [userEmail] = '[email protected]'
    GO
    
    
    ALTER TABLE [dbo].[cmsDocument] DROP CONSTRAINT [DF_cmsDocument_updateDate]
    GO
    ALTER TABLE [dbo].[cmsDocument] DROP CONSTRAINT [DF_cmsDocument_newest]
    GO
    
    TRUNCATE TABLE umbracoLog 
    GO
    --TRUNCATE TABLE umbracoUser2NodePermission
    --GO
    --TRUNCATE TABLE umbracoUserLogins
    --GO
    
    -- Create a temporary table for all documents which are published and not in the recycle bin
    CREATE TABLE #Nodes (id int)
    GO
    -- Delete all rows if the table exists before
    TRUNCATE TABLE #Nodes
    GO
    
    -- Insert all nodeIds from all documents which are published and not in the recycle bin
    INSERT INTO #Nodes 
        SELECT N.id 
        FROM umbracoNode N
            INNER JOIN cmsDocument D ON N.ID = D.NodeId
        WHERE nodeObjectType = 'C66BA18E-EAF3-4CFF-8A22-41B16D66A972'
            AND [path] NOT LIKE '%-20%'
            AND D.Published = 1
    GO
    
    -- Create a temporary table for all versionId's to delete
    CREATE TABLE #Versions (id UniqueIdentifier)
    GO
    -- Delete all rows if it exists before
    TRUNCATE TABLE #Versions
    GO
    
    -- Insert all versionId's from all nodeIds in the #Nodes table 
    -- and where published is set to false and newest is set to false
    INSERT INTO #Versions
        SELECT versionId 
        FROM cmsDocument 
        WHERE nodeId IN (SELECT id FROM #Nodes) AND published = 0 AND newest = 0
    GO
    
    -- DELETE all versions from cmsPreviewXml, cmsPropertyData, cmsContentVersion, cmsDocument
    -- from the nodes which are published and which are not in the recycle bin 
    -- and which are not published and which are not the newest
    DELETE FROM cmsPreviewXml WHERE versionId IN (SELECT id FROM #Versions)
    GO
    DELETE FROM cmsPropertyData WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    DELETE FROM cmsContentVersion WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    DELETE FROM cmsDocument WHERE VersionId IN (SELECT id FROM #Versions)
    GO
    
    -- Drop temp tables
    DROP TABLE #Versions
    GO
    DROP TABLE #Nodes
    GO
    
    -- Reindex tables  
    DBCC DBREINDEX (cmsPropertyData)
    DBCC DBREINDEX (cmsPreviewXml)
    DBCC DBREINDEX (cmsContentVersion)
    DBCC DBREINDEX (cmsDocument)
    DBCC DBREINDEX (cmsContentXml)
    DBCC DBREINDEX (umbracoDomains)
    --DBCC DBREINDEX (umbracoUser2NodePermission)
    DBCC DBREINDEX (umbracoNode)
    DBCC DBREINDEX (cmsContent)
    
    CREATE TABLE [dbo].[umbracoMediaVersion](
        [id] [int] NOT NULL,
        [path] [nvarchar](255) NULL,
     CONSTRAINT [PK_umbracoMediaVersion] PRIMARY KEY CLUSTERED 
    (
        [id] ASC
    ) ON [PRIMARY]
    ) ON [PRIMARY]
    GO
    
  • Benjamin Carleski 33 posts 294 karma points MVP c-trib
    Mar 14, 2019 @ 22:33
    Benjamin Carleski
    0

    In their blog post introducing Umbraco 8, HQ mentioned that automatic upgrades from v7 to v8 were not currently supported, but "very soon it will be possible to migrate your content". I've seen nothing saying they have released the ability to migrate content yet, so I think until that comes out, there isn't a supported path. That said, it looks like you've done a lot of work, maybe someone at HQ will see it and collaborate!

  • Sebastiaan Janssen 5060 posts 15522 karma points MVP admin hq
    Mar 14, 2019 @ 22:57
    Sebastiaan Janssen
    101

    Hi Ben, I'm sorry but this will definitely not be sufficient to migrate your db to v8.

    There is currently not an upgrade path to go from v7 to v8, there will be a migration path in the future: https://our.umbraco.com/documentation/Umbraco8FAQ#will-it-be-possible-to-upgrade-automatically-from-umbraco-7-to-umbraco-8

    We're working on it for v8.1.0 and ask for a little patience until then 👍

  • Ben Norman 167 posts 276 karma points
    Mar 14, 2019 @ 23:02
    Ben Norman
    0

    oh ok, no problem.

    thanks for getting back to me.

  • Jeffrey Weinstein 67 posts 313 karma points
    Jun 10, 2019 @ 11:06
    Jeffrey Weinstein
    0

    If there is any update on this, please post it in this thread..

  • john blair 48 posts 219 karma points
    Aug 20, 2019 @ 11:36
    john blair
    0

    I've migrated a v7.15 of the starter kit to v8.1.2 using umbraco migrations - excluding the app_plugins. The db migration went fine. Had to regenerate the code models which are now in a different namespace and global changes to the razor templates to reflect new v8 code base.

Please Sign in or register to post replies

Write your reply to:

Draft