Prepare 2 identical eZ Publish 4.7 installations, fully patched. I'll call them "server 1" and "server 2", for the sake of simplicity. With that done:
1. Server 1: create new class with one attribute:
2. Server 1: create a new object for that class;
3. Server 1: export package with class definition;
4. Server 1: export package with object;
5. Server 2: import class defnition package;
6. Server 2: import object package;
7. Server 2: edit ./kernel/classes/ezcontentclassattribute.php file, and on the initializeObjectAttributes() function, comment the following line (#988):
This will simulate/cause the DB corruption that is at the heart of this issue i.e. a class that has more attributes that the objects from that class.
8. Server 2: edit class and add a new attribute. Type is irrelevant for issue reproduction. For reference, created:
After this, server 2 will have a class with 2 attributes, and an object for that class with only one attribute.
9. Server 1: edit class and add a new attribute, with the exact same details of the object from the previous step;
At this stage, the content structure should be this:
10. Server 1: export a new package with the new version of the object. See attched screenshots (ExportStepByStep.zip) for reference;
11. Server 2: import the newly created package, and update the existing object. See attached screenshots (ImportStepByStep.zip) for reference. The object only has 1 attribute, and after the update it should have 2.