Once again, I am stuck on something that feels like it should be trivial, but isn’t…
I am migrating a WordPress site to a new server, IP, and domain name. In the mysql backup from the original, I noticed a lot of IP addresses show up in the database for posts and static resources like uploads. I’m sure there’s something I’m missing, but I would like all those references to point at my shiny new domain name, rather than pointing at a soon-to-be-dead IP address on a different cloud service.
Has anyone ever done an export/import like this before, and come across this issue? More to the point, do you know how to fix it?
I figured it out, but not super satisfactorily. I had to update the siteurl and home options in the wp_settings table of the database - these are used to write links and redirects. I don’t know how you would do that as part of an automated migration without some kind of custom script.
The great thing about this is that every day brings a new issue to bang my head off a wall about.
Today, I spent two hours trying to add https support to my proxy. The first hour I was trying to figure out why remote traffic wasn’t working - a reboot fixed it (I think I had an orphaned container blocking a port from a bad config). The second hour, after getting an SSL cert issued, was trying to figure out why my proxy config wasn’t working. The nginx config looked perfect. Eventually…duh - I changed docker-compose.yml and passed port 443 through from the host to the proxy container, and the world was right again.
Oh - and apparently you can set the site URL and home parameters in wp-config.php.