XMLException (Invalid character) while upgrading content database from SharePoint 2007 to SharePoint 2010

357 Views Asked by At

I am trying to upgrade some of the content databases from SharePoint 2007 to SharePoint 2010. I have resolved all the feature dependencies required to upgrade the content databases. Two of the content databases got upgraded just fine but one of the upgrade fails with the following error in the error log file:-

[STSADM] [SPContentDatabaseSequence] [INFO] [8/25/2012 3:08:13 PM]: SPContentDatabase Name=ANONYMOUS_ContentDB
[STSADM] [SPContentDatabaseSequence] [ERROR] [8/25/2012 3:08:13 PM]: Action 4.0.2.0 of Microsoft.SharePoint.Upgrade.SPContentDatabaseSequence failed.
[STSADM] [SPContentDatabaseSequence] [INFO] [8/25/2012 3:08:13 PM]: SPContentDatabase Name=ANONYMOUS_ContentDB
[STSADM] [SPContentDatabaseSequence] [ERROR] [8/25/2012 3:08:13 PM]: Exception: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 10023.
[STSADM] [SPContentDatabaseSequence] [INFO] [8/25/2012 3:08:13 PM]: SPContentDatabase Name=ANONYMOUS_ContentDB
[STSADM] [SPContentDatabaseSequence] [ERROR] [8/25/2012 3:08:13 PM]:    at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.ThrowInvalidChar(Int32 pos, Char invChar)
   at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
   at System.Xml.XmlTextReaderImpl.ParseText()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at Microsoft.SharePoint.Upgrade.RemoveContentTypeField.UpgradeSchema(String originalSchema, String& newSchema, Boolean& AddIndex)
   at Microsoft.SharePoint.Upgrade.RemoveContentTypeField.Upgrade()
   at Microsoft.SharePoint.Upgrade.SPActionSequence.Upgrade()

I am using command

stsadm -o addcontentdb -url "webappurl" -databasename "contentdbname"

to attach and upgrade the content database.

Can anyone please guide me as to what might be the problem here???

1

There are 1 best solutions below

1
On

From looking at the log files, it would seem that the XML schema of one of the content types in the site on that content database has an invalid character.

Could be tricky to diagnose. This is the 'long-route' - others may have a better route.

Could you backup the content database so that you can get back to where you started and then slowly delete content types until the stsadm command works (you will need to delete items that use the content type to be able to delete the content type). Do custom content types first as they are more likely to be the culprits. If you find out the content type with the invalid schema you can then either try and fix the schema or continue with out the content type if possible.