Do a search here and you will find numerous threads that will help you.
Yes, this can be done and this is the time to check it out.
However, this is not like dropping an old time small block Chevy into a GM car. The issue is complex and you need some pros to do the work. This will not be cheap but since you are doing an engine anyway ..........
Largely, it is an issue of electronic compatibility but there are some mechanical issues to boot.
Good luck and keep the thread alive!!!!!