Cloning a Wordpress installation is a very quick way to toy with Wordpress, make changes without worrying about breaking something, or just have a separate copy of the install without having to be in the same workspace as your friend/colleague.
When you clone a workspace, everything within that whole environment is cloned, including the database, value for value. This means that URLs and domain names on that Wordpress install will still be pointing to the old workspace’s information and things will break.
While there are instructions on how to do this at the official Moving Wordpress thread (under Changing Your Domain Name and URLs), the following instructions should suffice.
- Install WP-CLI (See guide here)
- Run a
search-replacefor your previous application preview URL and your new application preview URL.
- The command will look like this:
wp search-replace 'old-url.c9users.io' 'new-url.c9users.io'
Note: You can include your entire application URL if you’d like but just the chunk of it that’s actually different is necessary. If you’re cloning from an old workspace that uses
c9users.iothen be sure to include that part of the URL in the search-replace.