I wanted to duplicate my WordPress site, and make just a few small changes to the duplicate. However, after duplicating the site, I have had problems with the links sending the user back to the original site. Both the original and duplicate site should function. Here are the steps I have taken:
- I duplicated my entire site's WordPress files and placed them in a folder in the public_html directory, where the original site is located.
- I made a dump of the original DB and changed all the table prefixes (that were
wp_
) tonewsite_
. I did a search-and-replace in the MySQL dump forhttp://www.originalsite.com
to replace withhttp://www.originalsite.com/newsite
. I then imported that edited DB dump into the same database where the original site's DB is. - I opened up wp_config.php and changed
$table_prefix = 'wp_'
to$table_prefix = 'newsite_'
- Realising I couldn't log into the duplicated site, I followed the advice in this stack answer and changed the two key names in
newsite_usermeta
andnewsite_options
.
I am able to visit the home page of the duplicated site and I am able to login to the backend. However, all links on the site take the user to the correct page, but on the original site. It is not just the clickable links that are not working correctly, when the desired subpage address is typed into the url bar, the user is again taken to that page on the original site.
Currently the .htaccess
file contains:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Do I need to edit this at all?
What steps am I missing in the migration process?
site_url
option? Have you rebuilt .htaccess contents? Have you regenerated permalinks for attachments?