Question

I'm migrating an SQL Database (Umbraco 6.1.6) to SQL Azure and facing several problems when importing the data. It's felling a bit like this.

Following the current wiki, with the difference that I have to execute sqlcmd to run the data script, because the file as approximately 500MB.

sqlcmd -U user_dbo -P password -S cloudserver -d Database -i c:\script\data.sql -o c:\azuremigration.txt

Through the process on my output file I get several errors like:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_cmsPropertyData_umbracoNode". The conflict occurred in database "xxx", table "dbo.umbracoNode", column 'id'.
The statement has been terminated.

Msg 547, Level 16, State 1, Server xxx, Line 49
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_cmsDocument_cmsContent". The conflict occurred in database "xxx", table "dbo.cmsContent", column 'nodeId'.
The statement has been terminated.

Msg 547, Level 16, State 1, Server xxx, Line 20
The INSERT statement conflicted with the FOREIGN KEY constraint "FK_cmsPropertyData_cmsPropertyType". The conflict occurred in database "xxx", table "dbo.cmsPropertyType", column 'id'.

When the data is 'partially' imported accessing the backoffice, or any page of the site I got this SQL exception:

 Invalid object name 'cmsPropertyTypeGroup'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Data.SqlClient.SqlException: Invalid object name 'cmsPropertyTypeGroup'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[SqlException (0x80131904): Invalid object name 'cmsPropertyTypeGroup'.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +388
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +815
   System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +4515
   System.Data.SqlClient.SqlDataReader.TryConsumeMetaData() +69
   System.Data.SqlClient.SqlDataReader.get_MetaData() +134
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +6553981
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, SqlDataReader ds) +6556619
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite) +586
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +104
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +288
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +171
   StackExchange.Profiling.Data.ProfiledDbCommand.ExecuteDbDataReader(CommandBehavior behavior) +101
   System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader() +17
   Umbraco.Core.Persistence.<>c__DisplayClass4.<ExecuteReaderWithRetry>b__3() +277
   Umbraco.Core.Persistence.FaultHandling.RetryPolicy.ExecuteAction(Func`1 func) +545
   Umbraco.Core.Persistence.<Query>d__1c`1.MoveNext() +1287
   System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +536
   System.Linq.Enumerable.ToList(IEnumerable`1 source) +80
   Umbraco.Core.Persistence.Repositories.ContentTypeBaseRepository`2.GetPropertyGroupCollection(Int32 id, DateTime createDate, DateTime updateDate) +1712
   Umbraco.Core.Persistence.Repositories.ContentTypeRepository.PerformGet(Int32 id) +651
   Umbraco.Core.Persistence.Repositories.RepositoryBase`2.Get(TId id) +123
   Umbraco.Core.Persistence.Repositories.<PerformGetByQuery>d__f.MoveNext() +785
   System.Linq.Enumerable.FirstOrDefault(IEnumerable`1 source) +247
   Umbraco.Core.Services.ContentTypeService.GetContentType(String alias) +548
   Umbraco.Core.<>c__DisplayClass3.<GetDataType>b__0(Tuple`2 tuple) +68
   System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) +112
   Umbraco.Web.PublishedContentExtensions.GetPropertyValue(IPublishedContent prop, String alias, Boolean recursive, T ifCannotConvert) +247
   Umbraco.Web.Routing.PublishedContentRequestEngine.FollowInternalRedirects() +91
   Umbraco.Web.Routing.PublishedContentRequestEngine.HandlePublishedContent() +664
   Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContentAndTemplate() +264
   Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +103
   Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +457
   System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +80
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165

Also tried to use the Red Gate Data Compare tool, they don't output me errors, but my end result is the same.

Any ideas to make this process less painfull and actually working A ok?

Was it helpful?

Solution

It seems that the wiki is missing one important step.

It has to be scripted for Azure:

enter image description here

Edit: This is after step 10 in the wiki

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top