2
我正在將SQL數據庫(Umbraco 6.1.6)遷移到SQL Azure,並在導入數據時遇到幾個問題。它的感覺有點像this。從SQL到SQL Azure的Umbraco遷移
繼當前的wiki之後,我不得不執行sqlcmd來運行數據腳本,因爲該文件大約爲500MB。
sqlcmd -U user_dbo -P password -S cloudserver -d Database -i c:\script\data.sql -o c:\azuremigration.txt
通過對我的輸出文件的過程中,我得到一些錯誤,如:
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'.
當數據被「部分」進口訪問後臺,或本網站的任何頁面我得到這個SQL異常:
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
也試圖使用紅門數據比較工具,他們不會輸出我的錯誤,但我的最終結果是相同的。
任何想法,使這個過程不那麼痛苦和實際工作一個好嗎?
維基是不是真的完成後,我今天編輯。 SQL Azure需要所有表上的聚簇索引,所以這是一個問題,因爲umbraco安裝上的其他包上的舊依賴關係。其他問題之一實際上是你也提到的那個(感謝輸入)。就我而言,這個umbraco安裝以前是從4.7.x版本升級而來的。我的V6數據庫隱藏在一個不容易發現的名字後面,我仍然在v4數據庫上生成腳本。事實上,表'cmsPropertyTypeGroup'在V4數據庫模式中不存在。它解決了並且工作。 – antao