Bug reports Found a bug? Post it here please.
Version 6.x > Bug reports > Error during site import View modes: 
User avatar
Member
Member
Greg - 11/29/2013 9:25:29 AM
   
Error during site import
Hi,

I've tried to import a website (transfer from one installation of Kentico 6.23 to another) and keep having a following error.

Could you please let me know where could be a problem? I need to import this site pretty urgently- I don't care about configuration, users etc. as it is pretty basic but even if deselect a several options from import menu - it does not help and problem persists...
ERROR:  Error importing document '/About-Us'
Message: [DataConnection.ExecuteQuery]: Query: INSERT INTO CMS_Tree ([NodeAliasPath], [NodeName], [NodeAlias], [NodeClassID], [NodeParentID], [NodeLevel], [NodeACLID], [NodeSiteID], [NodeGUID], [NodeOrder], [IsSecuredNode], [NodeCacheMinutes], [NodeSKUID], [NodeDocType], [NodeHeadTags], [NodeBodyElementAttributes], [NodeInheritPageLevels], [NodeChildNodesCount], [RequiresSSL], [NodeLinkedNodeID], [NodeOwner], [NodeCustomData], [NodeGroupID], [NodeLinkedNodeSiteID] ) VALUES ( @NodeAliasPath, @NodeName, @NodeAlias, @NodeClassID, @NodeParentID, @NodeLevel, @NodeACLID, @NodeSiteID, @NodeGUID, @NodeOrder, @IsSecuredNode, @NodeCacheMinutes, @NodeSKUID, @NodeDocType, @NodeHeadTags, @NodeBodyElementAttributes, @NodeInheritPageLevels, @NodeChildNodesCount, @RequiresSSL, @NodeLinkedNodeID, @NodeOwner, @NodeCustomData, @NodeGroupID, @NodeLinkedNodeSiteID); SELECT SCOPE_IDENTITY() AS [NodeID]: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Tree_NodeOwner_CMS_User". The conflict occurred in database "EXT1_Microsites", table "dbo.CMS_User", column 'UserID'.
The statement has been terminated. Stack Trace: at CMS.DataProviderSQL.DataConnection.ExecuteScalar(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)
at CMS.DataEngine.GeneralConnection.ExecuteScalar(QueryParameters query)
at CMS.DataEngine.GeneralConnection.ExecuteScalar(String queryName, QueryDataParameters parameters)
at CMS.DataEngine.SimpleDataClass.Insert(Boolean getId)
at CMS.TreeEngine.TreeNode.Insert(TreeNode parent)
at CMS.WorkflowEngine.ContentDocument.Insert(TreeNode parent, Boolean useDocumentHelper)
at CMS.CMSImportExport.ImportProvider.ImportDocuments(SiteImportSettings settings, TranslationHelper th, List`1& importedDocumentIDs, TreeProvider tree) at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at CMS.DataProviderSQL.DataConnection.ExecuteScalar(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

ERROR: Error importing documents
Message: [DataConnection.ExecuteQuery]: Query: INSERT INTO CMS_Tree ([NodeAliasPath], [NodeName], [NodeAlias], [NodeClassID], [NodeParentID], [NodeLevel], [NodeACLID], [NodeSiteID], [NodeGUID], [NodeOrder], [IsSecuredNode], [NodeCacheMinutes], [NodeSKUID], [NodeDocType], [NodeHeadTags], [NodeBodyElementAttributes], [NodeInheritPageLevels], [NodeChildNodesCount], [RequiresSSL], [NodeLinkedNodeID], [NodeOwner], [NodeCustomData], [NodeGroupID], [NodeLinkedNodeSiteID] ) VALUES ( @NodeAliasPath, @NodeName, @NodeAlias, @NodeClassID, @NodeParentID, @NodeLevel, @NodeACLID, @NodeSiteID, @NodeGUID, @NodeOrder, @IsSecuredNode, @NodeCacheMinutes, @NodeSKUID, @NodeDocType, @NodeHeadTags, @NodeBodyElementAttributes, @NodeInheritPageLevels, @NodeChildNodesCount, @RequiresSSL, @NodeLinkedNodeID, @NodeOwner, @NodeCustomData, @NodeGroupID, @NodeLinkedNodeSiteID); SELECT SCOPE_IDENTITY() AS [NodeID]: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Tree_NodeOwner_CMS_User". The conflict occurred in database "EXT1_Microsites", table "dbo.CMS_User", column 'UserID'.
The statement has been terminated. Stack Trace: at CMS.CMSImportExport.ImportProvider.ImportDocuments(SiteImportSettings settings, TranslationHelper th, List`1& importedDocumentIDs, TreeProvider tree)
at CMS.CMSImportExport.ImportProvider.ImportDocumentsData(SiteImportSettings settings, TranslationHelper th) at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at CMS.DataProviderSQL.DataConnection.ExecuteScalar(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

ERROR: Error during import process
Message: [DataConnection.ExecuteQuery]: Query: INSERT INTO CMS_Tree ([NodeAliasPath], [NodeName], [NodeAlias], [NodeClassID], [NodeParentID], [NodeLevel], [NodeACLID], [NodeSiteID], [NodeGUID], [NodeOrder], [IsSecuredNode], [NodeCacheMinutes], [NodeSKUID], [NodeDocType], [NodeHeadTags], [NodeBodyElementAttributes], [NodeInheritPageLevels], [NodeChildNodesCount], [RequiresSSL], [NodeLinkedNodeID], [NodeOwner], [NodeCustomData], [NodeGroupID], [NodeLinkedNodeSiteID] ) VALUES ( @NodeAliasPath, @NodeName, @NodeAlias, @NodeClassID, @NodeParentID, @NodeLevel, @NodeACLID, @NodeSiteID, @NodeGUID, @NodeOrder, @IsSecuredNode, @NodeCacheMinutes, @NodeSKUID, @NodeDocType, @NodeHeadTags, @NodeBodyElementAttributes, @NodeInheritPageLevels, @NodeChildNodesCount, @RequiresSSL, @NodeLinkedNodeID, @NodeOwner, @NodeCustomData, @NodeGroupID, @NodeLinkedNodeSiteID); SELECT SCOPE_IDENTITY() AS [NodeID]: caused exception: The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Tree_NodeOwner_CMS_User". The conflict occurred in database "EXT1_Microsites", table "dbo.CMS_User", column 'UserID'.
The statement has been terminated. Stack Trace: at CMS.CMSImportExport.ImportProvider.ImportDocumentsData(SiteImportSettings settings, TranslationHelper th)
at CMS.CMSImportExport.ImportProvider.ImportObjectsData(SiteImportSettings settings) at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
at System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
at System.Data.SqlClient.SqlDataReader.TryConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource`1 completion, Int32 timeout, Task& task, Boolean asyncWrite)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteScalar()
at CMS.DataProviderSQL.DataConnection.ExecuteScalar(String queryText, QueryDataParameters queryParams, QueryTypeEnum queryType, Boolean requiresTransaction)

User avatar
Member
Member
kentico_sandroj - 11/30/2013 4:58:35 PM
   
RE:Error during site import
Hello,

This appears to be an issue with database inconsistencies in the CMS_User table:

The INSERT statement conflicted with the FOREIGN KEY constraint "FK_CMS_Tree_NodeOwner_CMS_User"


How do the two instances relate? Is it an option to use the backup/restore approach for transferring the site? In that case the inconsistencies would not be an issue. If you do not need the existing users from one site or the other, another option may be to delete the users from one instance and try the import again.

Best Regards,
Sandro