A. The code below can be used to modify the paths used inside of WordPress when transferring to a new domain, or to a new path on the same domain. Only run the file once and then delete it from the server. Also, first backup the database incase you run into any issues.
Additional Steps:
Make sure to update wp_options table where you see former domain name to using the new domain.
In WP Multisite (Our WP Replicating Blog feature) you must also update the wp_blogs table where you see the old domain in the domain field for each site.