Hello
You would also need to run the search and replace script - to update the old URL to the new URL in your Moodle database.
You can read the brief details here:
https://docs.moodle.org/36/en/Search_and_replace_tool
Please be advised, this is a direct UPDATE via SQL operation on the database.
You cannot just "undo" this - so be every careful !
You should definitely make a copy of the database first, and be sure that you know how to restore that database before you run this script.
I have used this function maybe a dozen times now ver the years, and it only ever failed once (and that was because the server in question already had several other major issues).
Hoe this helps, Stuart.