You can use Python to loop through the Sharing API and update the URLs for web apps to point to the new URL. A few of the examples for the Python API have code to loop through users and content so they can be used as a starting point:
thank you for answer, the URL that opens the web application, inside the Web Mapping Application settings, is correct but I get an error for an inside url. I attach some screenshots:
here you can see the wrong /arcgis/sharing/rest/... URL, where come it from?