If you gave the new router the same SSID and the same password as the old one, it should work. If these are different, you have to run the WiFi setup of the printer again to tell it about the new situation.