a.newton-rocksolid.com
-
6/23/2013 7:24:25 PM
RE:Missing Custom Field Data After Import (Kentico V7)
It occurred to me to try a full import again as I had worked on some other tasks on Friday that may have caused the databases to be out of sync.
After a full import from staging to test (to a completely new site on test) this is what I found:
USE staging_stagingTest;
SELECT MenuItemID, MenuItemName, PromoteHomeLeft FROM CONTENT_MenuItem WHERE PromoteHomeLeft = 1;
USE test_stagingTest;
SELECT MenuItemID, MenuItemName, PromoteHomeLeft FROM CONTENT_MenuItem WHERE PromoteHomeLeft = 1;
result:
MenuItemID MenuItemName PromoteHomeLeft ----------- ------------- --------------- 978 Get informed 1
(1 row(s) affected)
MenuItemID MenuItemName PromoteHomeLeft ----------- ------------- --------------- 2114 Get informed 1
(1 row(s) affected)
So now I can see both values coming through, but the content I was expecting still isn't showing up on the home page.
I have checked CMS Site Manager > Administration > System, and the database was as expected in both cases.
The transformation used would roughly translate to the following SQL -
SELECT TOP 1 * -- ParentDocument.DocumentName AS 'DocName', CMS_Tree.NodeAliasPath AS ParentDocumentNodeAliasPath, * FROM View_CMS_Tree_Joined_Attachments JOIN CONTENT_File on FileAttachment = AttachmentGUID JOIN CMS_Document ParentDocument ON NodeParentID = ParentDocument.DocumentID JOIN CONTENT_MenuItem ON MenuItemID = ParentDocument.DocumentForeignKeyValue JOIN CMS_Attachment ON FileAttachment = CMS_Attachment.AttachmentGUID JOIN CMS_Tree ON CMS_Tree.NodeID = ParentDocument.DocumentID WHERE 1=1 AND CMS_Attachment.AttachmentImageWidth = 273 AND CONTENT_MenuItem.PromoteHomeLeft = 1
As I'd already suspected, this might be a problem with these IDs being out of sync. I ran the following query:
USE staging_stagingTest;
SELECT MenuItemID, MenuItemName, PromoteHomeLeft FROM CONTENT_MenuItem WHERE PromoteHomeLeft = 1;
SELECT DocumentID, DocumentName, DocumentModifiedWhen, DocumentForeignKeyValue FROM dbo.CMS_Document WHERE DocumentForeignKeyValue = 978
USE test_stagingTest;
SELECT MenuItemID, MenuItemName, PromoteHomeLeft FROM CONTENT_MenuItem WHERE PromoteHomeLeft = 1;
SELECT DocumentID, DocumentName, DocumentModifiedWhen, DocumentForeignKeyValue FROM dbo.CMS_Document WHERE DocumentForeignKeyValue = 978 SELECT DocumentID, DocumentName, DocumentModifiedWhen, DocumentForeignKeyValue FROM dbo.CMS_Document WHERE DocumentForeignKeyValue = 2214;
Results:
MenuItemID MenuItemName PromoteHomeLeft ----------- ------------- --------------- 978 Get informed 1 (1 row(s) affected) DocumentID DocumentName DocumentModifiedWhen DocumentForeignKeyValue ----------- ------------- ----------------------- ----------------------- 1209 Get informed 2013-06-12 17:53:12.363 978 (1 row(s) affected) MenuItemID MenuItemName PromoteHomeLeft ----------- ------------- --------------- 2114 Get informed 1 (1 row(s) affected) DocumentID DocumentName DocumentModifiedWhen DocumentForeignKeyValue ----------- ------------- ----------------------- ----------------------- 3951 images 2013-05-23 16:54:57.223 978 (1 row(s) affected) DocumentID DocumentName DocumentModifiedWhen DocumentForeignKeyValue ----------- ------------- ----------------------- ----------------------- (0 row(s) affected)
So it seems that the problem is indeed that the CMS_Document IDs are getting out of sync as a result of the auto-increment on the CMS_Document table. Is there a way to resolve this without physically dropping the table from test_stagingTest? I might try and rework my query to avoid this issue, but it would be really nice to be able to do this without needing to worry about this issue.
|