Entities tend to get serialized in various places : cache, forms...
ConfigEntities, being more business oriented, additionally tend to get more business specific helper methods, possibly relying on internal properties / derived data / external services, other than their raw data, and which you usually don't want to serialize.
Nice thing is, ConfigEntities have a pretty straightforward serialization format: the exported properties that end up in their CMI file...
We had to do this for Field / FieldInstance entities, that fall exactly in this case above, but the code is pretty agnostic and might make sense for all ConfigEntity types.
(since then, duplicated that same code in EntityFormDisplay - leaving the symmetrical EntityViewDisplay out).
Basically, serialize to the raw array returned by getExportProperties() (as if it was going to CMI), and unserialize by passing this array to __construct() (just as if it was read from config). Same format, different storage.
Patch once I get a node id.
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] 97,779 pass(es), 106 fail(s), and 133 exception(s).
FAILED: [[SimpleTest]]: [PHP 5.5 MySQL] Unable to apply patch 1977206-58.patch. Unable to apply patch. See the log in the details link for more information.
FAILED: [[SimpleTest]]: [PHP 5.4 MySQL] 94,920 pass(es), 290 fail(s), and 76 exception(s).