2014-02-20 3 views
2

Я переношу базу данных SQL (Umbraco 6.1.6) в SQL Azure и сталкиваюсь с несколькими проблемами при импорте данных. Это немного похоже на this.Переход Umbraco с SQL на SQL Azure

В соответствии с текущим wiki с той разницей, что я должен выполнить sqlcmd для запуска сценария данных, потому что файл составляет приблизительно 500 МБ.

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'. 

Когда данные «частично» импортирован доступ к BackOffice или любой странице сайта я получил это 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 

Также попытался использовать инструмент сравнения данных красных ворот, они не выдают мне ошибок, но мой конечный результат тот же.

Любые идеи, чтобы сделать этот процесс менее болезненным и фактически работающим. Хорошо?

ответ

1

Кажется, что вики не хватает одного важного шага.

Он должен быть сценарий для Azure:

enter image description here

Edit: Это после шага 10 в вики

+0

вики на самом деле не завершена, я буду редактировать его сегодня. Для SQL Azure требуются кластерные индексы во всех таблицах, поэтому это проблема из-за старых зависимостей от других пакетов в установке umbraco. Одна из других проблем была на самом деле той, которую вы упомянули (спасибо за ввод). В моем случае эта установка umbraco была ранее обновлена ​​с версии 4.7.x. Моя база данных V6 была скрыта за не очень понятным именем, и я все еще создавал скрипты в базе данных v4. Фактически, таблица 'cmsPropertyTypeGroup' не существует в схеме V4 db. Он решен и работает. – antao

Смежные вопросы