Replace all uses of old deriving attribute with new one

Closes #5411.