M54 b30 is not heavier than the m54b25. IT's basically the same block, only different stroke (maybe a few grams difference because of the different intake, sound generator etc).
Also I don't know if the 2.5i clutch will align on the 3.0i flywheel, or that the 2.5i flywheel will fit the 3.0i crank They differ (2.5i also has the 5 speed)
But biggest problem is the ecu. You not only need the ecu, but also the ews (or recode), throttle body, maf (both differ from 2.5i).
And swapping over the ecu/ews will give the anti tamper dot in the binnacle.. so maybe swap that too (I don't know in how many modules mileage is stored)
of course if you have a complete donorcar with everything working you can swap the entire drivetrain incl keys etc. Then you can also use the 6 speed and diff with alternate gear ratio (if everything is still in good nick)
It's not disconnecting a few hoses&cables, split at the gearbox and hoist in the next engine.