When you want to e.g. publish your WordPress driven development site you probably need to change domain settings in WordPress. It’s not hard at all when you prepare a bit and know what you’re doing.
Too many posts in the internet just says that “go to admin panel and change site url”. Then it should work. Sometimes I wonder how much of testing have those people with this kind of instructions done before writing it down 🙂
So what you need to do?
- Get your WordPress to new server (if needed). You can follow these instructions I have written down earlier.
- It’s important that new domain is directed to this server (DNS).
- If your new server has WP-CLI available, use it.
$ wp search-replace 'http://example.old' 'http://example.new' --skip-columns=guid
4. It works. It’s actually a lot easier than many other possibilities. And it takes care all the serialized data in the same time.
If you don’t have WP-CLI available, check Moving WordPress from codex for other options. Just keep in mind that just changing SITE_* constants are not enough but you need to search and replace database.
I’m yet to understand why WordPress stores so eagerly absolute paths to database but it really does so often. It would make a lot more sense to use just relative URLs to everything but maybe there’s something related to multiuser wordpresses that makes sense. However, I don’t understand it.
I run my WordPress and Woocommerce sites proudly in Opalstack shared hosting provider. A lot of ex-Webfaction clients have moved to Opalstack and they’ve experience quite a growth. You may want to check it out.