Remove some attributes when persisting.

These are of no use when the entity shall be restored.