Cloning a Wordpress Install

wordpress

#1

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.

  1. Install WP-CLI (See guide here)
  2. Run a search-replace for 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 c9.io rather than c9users.io then be sure to include that part of the URL in the search-replace.


Wordpress wp-login.php Redirecting to wrong URL
Tutorials - Table of Contents
#2

#3

#4

I have do exactly as your guide , but when i run my cloned wordpress site, it redirect the original site such as : https://edubay-cloned-huystart17.c9users.io/ will redirect to https://edubay-huystart17.c9users.io/ . Can you help me, please? thank


#5

Hi!

It happened to me as well. It’s caching issue. Below link helped me.

https://wordpress.stackexchange.com/questions/221905/redirecting-to-old-domain-tried-everything-nothing-works

As Sumit pointed out, the problem was in the old browser cache. The solution was to clear browser cache (or just add a query string after the address: http://my.new.domain/?random_string).