Staging sync error

Brian Brown asked on October 26, 2022 15:59

I'm trying to sync my page to production and am receiving this error on some pages, others are fine.

SyncServer.ServerError: Exception occurred: [DataConnection.HandleError]: Query: UPDATE CMS_PageTemplate SET [PageTemplateLastModified] = @PageTemplateLastModified, [PageTemplateDefaultController] = @PageTemplateDefaultController, [PageTemplateDefaultAction] = @PageTemplateDefaultAction WHERE [PageTemplateID] = @PageTemplateID Caused exception: Invalid column name 'PageTemplateDefaultController'. Invalid column name 'PageTemplateDefaultAction'.

Some background this project was a Kentico 9 but has been upgraded to Kentico 12 over the years. If that makes any difference.

Recent Answers


Brian Brown answered on October 26, 2022 17:12

I noticed in CMS_Class ClassName cms.pagetemplate XML Schema didn't match another unrelated Kentico 12 site, can I just modify it???

Broken site

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CMS_PageTemplate">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="PageTemplateID" msdata:ReadOnly="true" msdata:AutoIncrement="true" type="xs:int" />
              <xs:element name="PageTemplateDisplayName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCodeName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateDescription" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateFile" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="400" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCategoryID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateLayoutID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateWebParts" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsReusable" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateShowAsMasterTemplate" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateInheritPageLevels" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateLayout" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateVersionGUID" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateHeader" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" />
              <xs:element name="PageTemplateLastModified" type="xs:dateTime" />
              <xs:element name="PageTemplateSiteID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateForAllPages" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateType">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateLayoutType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCSS" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsAllowedForProductSection" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateInheritParentHeader" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateAllowInheritHeader" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateThumbnailGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
              <xs:element name="PageTemplateCloneAsAdHoc" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateDefaultController" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateDefaultAction" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateNodeGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
              <xs:element name="PageTemplateMasterPageTemplateID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateProperties" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsLayout" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateIconClass" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//CMS_PageTemplate" />
      <xs:field xpath="PageTemplateID" />
    </xs:unique>
  </xs:element>
</xs:schema>

Working Site

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="NewDataSet" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
  <xs:element name="NewDataSet" msdata:IsDataSet="true" msdata:UseCurrentLocale="true">
    <xs:complexType>
      <xs:choice minOccurs="0" maxOccurs="unbounded">
        <xs:element name="CMS_PageTemplate">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="PageTemplateID" msdata:ReadOnly="true" msdata:AutoIncrement="true" type="xs:int" />
              <xs:element name="PageTemplateDisplayName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCodeName">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="100" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateDescription" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateFile" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="400" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCategoryID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateLayoutID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateWebParts" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsReusable" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateShowAsMasterTemplate" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateInheritPageLevels" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateLayout" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateVersionGUID" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateHeader" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" />
              <xs:element name="PageTemplateLastModified" type="xs:dateTime" />
              <xs:element name="PageTemplateSiteID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateForAllPages" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateType">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="10" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateLayoutType" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="50" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateCSS" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsAllowedForProductSection" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateInheritParentHeader" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateAllowInheritHeader" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateThumbnailGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
              <xs:element name="PageTemplateCloneAsAdHoc" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateNodeGUID" msdata:DataType="System.Guid, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" type="xs:string" minOccurs="0" />
              <xs:element name="PageTemplateMasterPageTemplateID" type="xs:int" minOccurs="0" />
              <xs:element name="PageTemplateProperties" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="2147483647" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
              <xs:element name="PageTemplateIsLayout" type="xs:boolean" minOccurs="0" />
              <xs:element name="PageTemplateIconClass" minOccurs="0">
                <xs:simpleType>
                  <xs:restriction base="xs:string">
                    <xs:maxLength value="200" />
                  </xs:restriction>
                </xs:simpleType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:choice>
    </xs:complexType>
    <xs:unique name="Constraint1" msdata:PrimaryKey="true">
      <xs:selector xpath=".//CMS_PageTemplate" />
      <xs:field xpath="PageTemplateID" />
    </xs:unique>
  </xs:element>
</xs:schema>
0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on October 27, 2022 08:36

It looks like something went wrong when upgrading - that column was removed in v12: screen shot. It seems that something was not updated correctly.

I would recommend restoring v11 backups and upgrade again.

Or, if you feel confident, update the Class XML schema - make sure you have backups ready! Making a mistake here can cause data loss! App restart is required after making DB changes.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.