Migrate attributes before setting.