@JamesL is correct. It is where the ball was last touched unless the ball was in the penalty area when play was stopped, in which case it goes to the GK no matter where the last touch was.
In this case, best decision would have been to stop as soon as the goal has clearly moved and drop ball to the Keeper as the ball is still in that part of the pitch and very much in danger of the moved goal becoming an issue.
An interesting supplementary question is what you do if the first thing that happens after the goal moves is a promising attack in the other direction. I can't think of anything in Law that says we need to stop the game immediately if it's not causing a practical issue. If the corner flag came out, we would just replace at the next stoppage in play.