Migrate database to Umbraco version 6.2.4
- Take a copy of your database
- Create a new empty MVC project in Visual Studio
- Install Umbraco version 6.2.4 via Package Manager Install-Package UmbracoCms -Version 6.2.4
- Add the connections string to the copy of your database in the web.config
- Run the site
- On the install screen run the database upgrade – this might take some time.
- Once complete close the site and touch the web.config. Then restart the site and go to the umbraco folder. If it you don’t get there try this step again.
- You now have a database that has been migrated to Umbraco version 6.2.4
Migrate database from Umbraco version 6.2.4 to version 7.0.4
- Create a new empty MVC project in Visual Studio
- Install Umbraco version 7.0.4 via Package Manager Install-Package UmbracoCms -Version 7.0.4
- Add the connections string to the copy of your database in the web.config
- Run the site
- You will now run into this screen warning you that some of your property editors are not compatible and will be converted to labels. (note that this image is from an upgrade to version 7.2.1 that did not succeed like the upgrade to 7.0.4 did)
- After pressing Continue you might encounter this error message
The database configuration failed with the following message: The operation failed because an index or statistics with name ‘IX_umbracoNodeTrashed’ already exists on table ‘umbracoNode’. Please check log file for additional information (can be found in ‘/App_Data/Logs/UmbracoTraceLog.txt’)
- Open your SQL Server Management Studio
- Find and delete the ‘IX_umbracoNodeTrashed’ in the ‘umbracoNode’ table
- You might then encounter this error
The database configuration failed with the following message: The operation failed because an index or statistics with name ‘IX_cmsContentVersion_ContentId’ already exists on table ‘cmsContentVersion’. Please check log file for additional information (can be found in ‘/App_Data/Logs/UmbracoTraceLog.txt’)
- Find and delete the ‘IX_cmsContentVersion_ContentId’ in the ‘cmsContentVersion’ table
- You might then encounter this error
The database configuration failed with the following message: The operation failed because an index or statistics with name ‘IX_cmsDocument_published’ already exists on table ‘cmsDocument’. Please check log file for additional information (can be found in ‘/App_Data/Logs/UmbracoTraceLog.txt’)
- Find and delete the ‘IX_cmsDocument_published’ in the ‘cmsDocument’ table
- You might then encounter this error
The database configuration failed with the following message: The operation failed because an index or statistics with name ‘IX_cmsDocument_newest’ already exists on table ‘cmsDocument’. Please check log file for additional information (can be found in ‘/App_Data/Logs/UmbracoTraceLog.txt’)
- Find and delete the ‘IX_cmsDocument_newest’ in the ‘cmsDocument’ table
- If you encounter this error you need to check your content and delete the duplicate entry
The database configuration failed with the following message: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name ‘dbo.cmsMacro’ and the index name ‘IX_cmsMacro_Alias’. The duplicate key value is (TonePrintCheck). The statement has been terminated. Please check log file for additional information (can be found in ‘/App_Data/Logs/UmbracoTraceLog.txt’)
- Find and delete the the duplicate entry (TonePrintCheck (in our case id 113 and 114 hoth had the macroAlias ‘TonePrintCheck’ – se we deleted the row with id 114) in the ‘dbo.cmsMacro’ table
- For the below errors follow the guidelines provided on the Umbraco forum (look for Kristian Ravnevand’s answer). Alternatively you can take a look below:
- You might then encounter this error
--- fix error no. 1 /** The database configuration failed with the following message: 'DF_cmsMacroProperty_macroPropertyHidden' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt') */ ALTER TABLE [dbo].[cmsMacroProperty] drop CONSTRAINT [DF_macroProperty_macroPropertyHidden] go ALTER TABLE [dbo].[cmsMacroProperty] ADD CONSTRAINT [DF_cmsMacroProperty_macroPropertyHidden] DEFAULT ('0') FOR [macroPropertyHidden] GO
- Run the above query
- You might then encounter this error
--- fix error no. 2 /** The database configuration failed with the following message: 'FK_cmsMacroProperty_cmsMacroPropertyType_id' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt') */ ALTER TABLE [dbo].[cmsMacroProperty] WITH CHECK ADD CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id] FOREIGN KEY([macroPropertyType]) REFERENCES [dbo].[cmsMacroPropertyType] ([id]) GO ALTER TABLE [dbo].[cmsMacroProperty] CHECK CONSTRAINT [FK_cmsMacroProperty_cmsMacroPropertyType_id] GO --- Error no. 3 ALTER TABLE [dbo].[cmsMacroProperty] DROP CONSTRAINT [FK_umbracoMacroProperty_umbracoMacroPropertyType] GO
- Run the above query
- You might then encounter this error
--- fix error no. 4 /* The database configuration failed with the following message: 'FK_cmsTagRelationship_umbracoNode_id' is not a constraint. Could not drop constraint. See previous errors. Please check log file for additional information (can be found in '/App_Data/Logs/UmbracoTraceLog.txt') */ ALTER TABLE [dbo].[cmsTagRelationship] WITH CHECK ADD CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id] FOREIGN KEY([nodeId]) REFERENCES [dbo].[umbracoNode] ([id]) GO ALTER TABLE [dbo].[cmsTagRelationship] CHECK CONSTRAINT [FK_cmsTagRelationship_umbracoNode_id] GO
- Run the above query
- Run the installer again and wait…
- The installer might hang on 90%. That’s no problem.
- Go to your web.config and set the version number manually to 7.0.4 – <add key=”umbracoConfigurationStatus” value=”7.0.4″ />
- Once complete close the site and touch the web.config. Then restart the site and go to the umbraco folder. If it you don’t get there try this step again. I had to do this a lot of times before it finally showed the login screen. You might also want to restart Visual Studio completely – that was what finally did the trick for me.
- You should now have an upgraded database.
Now that you have an upgraded database, ‘all’ you have to do is transfer and convert your template to razor view files if they are not already, update/make property editors that fit the ones that are converted to labels, and probably a bunch of other things.
Thank you very much.
Post well written. It works perfectly!