Engine change for E90 N47D20A to N47D20C

I want to use the F30 320d (N47D20C) engine into a E90 320d (N47D20C) is it possible to do this engine change?