SerializationException may appear in log after upgrading Sitecore XP


Description

After upgrading from the initial Sitecore XP 8.0 release to a newer version, the following error may appear in the log files:

 Exception: System.Runtime.Serialization.SerializationException
Message: Member 'LockContext.ListId' was not found.
Source: mscorlib
   at System.Runtime.Serialization.SerializationInfo.GetValue(String name, Type type)
   at Sitecore.ListManagement.ContentSearch.Pipelines.Locking.LockContext..ctor(SerializationInfo info, StreamingContext context)
   at Void .ctor(System.Runtime.Serialization.SerializationInfo, System.Runtime.Serialization.StreamingContext)(Object[] )
   ...

This may occur if there were contact lists that had been locked before starting the upgrade process.

List locking information is serialized in a different way from the initial Sitecore XP 8.0 release to the later Sitecore XP versions. This means that an error occurs when the previously locked lists are being deserialized.

Solution

To update the list locking information so it deserializes correctly, perform the following steps:

  1. Back up your solution.
  2. Run the following queries against the Master database:
    UPDATE [IDTable] SET CustomData = REPLACE(CustomData, '"ListId"', '"LockContext.ListId"')
    UPDATE [IDTable] SET CustomData = REPLACE(CustomData, '"LockId"', '"LockContext.LockId"')
    UPDATE [IDTable] SET CustomData = REPLACE(CustomData, '"LockKey"', '"LockContext.LockKey"')