if you only change the motor in theory it should work just resetting the encoder from the maintenance page of the HMI.
Do you have any alarm show on the Servodrive 1255U0?
Have you also changed Servodrive 1255Uo, in case yes should be programmed and configured.