Re: [bitfolk] Changing a WordPress site's hostname

Top Page

Reply to this message
Author: William Anderson
Date:  
To: users
Subject: Re: [bitfolk] Changing a WordPress site's hostname
On Tue, 18 Feb 2020 at 01:31, Andy Smith <andy@???> wrote:

> Hello,
>
> I know there's a few WordPress experts here. Can I pick your brains?
>
> Say I have a WP site at https://dev.example.com/ and I now want to
> copy it and put it live at https://example.com/. Having read:
>
>     https://wordpress.org/support/article/changing-the-site-url/

>
> do I just…
>
> - Copy the filesystem structure from one document root to another



Yup.

- Dump the database and re-insert it into a new database


Yup, then edit wp-config.php with your new database settings.

- Install wp-cli and run
>
> $ wp search-replace 'dev.example.com' 'example.com' --skip-columns=guid
>
> and then it's all switched?



Don’t do that last part unnecessarily - you should just be able to follow
the section titled “Changing the URL directly in the database” (editing the
‘home’ and ‘siteurl’ values in the wp_options table) and give the site a go.

If you have any plugins installed that for some reason store the site
address in their tables and/or config, then you may need to go down that
search and replace route, but most sane plugins should use those values in
the wp_options table.

-n

>