URLs Not Fully Updated After Cloning and Changing Domain in LocalWP

Hello,
I encountered an issue while using LocalWP (version 9.0.5+6706). After cloning a site and changing its domain, some URLs within my WordPress installation were not updated correctly. Specifically, when I cloned a site named ‘v6.6.1 tests validation’ to ‘v6.6.2 tests validation’ and changed the domain from ‘wpdistrib-v661’ to ‘wpdistrib-v662’, the URLs related to the ‘White Label’ plugin did not reflect this change and remained pointing to the old domain.

I manually corrected the issue by running SQL queries to replace the old URLs with the new ones in the database, but I believe this behavior indicates a bug in LocalWP’s cloning or domain-changing process. It seems that certain URLs, especially those stored by plugins, are not being properly updated during the domain change.

Steps to Reproduce:

  1. Clone a LocalWP site (‘v6.6.1 tests validation’) to a new site (‘v6.6.2 tests validation’).
  2. Change the domain of the cloned site from ‘wpdistrib-v661’ to ‘wpdistrib-v662’.
  3. Check the URLs within the ‘White Label’ plugin (or possibly other plugins/extensions).
  4. Notice that the old URLs are still present, referencing the previous domain (‘wpdistrib-v661’).

Expected Behavior:
All URLs, including those stored by plugins such as ‘White Label’, should be updated to reflect the new domain (‘wpdistrib-v662’) when the site is cloned and the domain is changed.

Workaround:
To fix the issue, I manually ran the following SQL queries to update the URLs in the database.

Please let me know if you need any further information to resolve this issue. I believe improving the domain change functionality would greatly enhance the user experience, especially for those working with custom plugins that store URLs in the database.

Thank you!

Ethan


Bug Summary

Some URLs, particularly from the ‘White Label’ plugin, are not updated when cloning a site and changing the domain in LocalWP. After changing the domain, certain URLs remain pointing to the previous domain.

Steps to Reproduce

  1. Clone a LocalWP site running WordPress 6.6.1 (e.g., ‘v6.6.1 tests validation’).
  2. Change the domain of the cloned site from ‘wpdistrib-v661’ to ‘wpdistrib-v662’.
  3. After the clone and domain change, inspect the URLs in the ‘White Label’ plugin (or other potential plugins).
  4. Notice that some URLs still reference the old domain (‘wpdistrib-v661’) instead of the new one (‘wpdistrib-v662’).

Environment Info

  • Operating System: Windows 11
  • LocalWP Version: 9.0.5+6706
  • Server Software: Apache 8.3.8
  • PHP Version: 8.3.8
  • MySQL Version: 8.0.16
  • WordPress Version: 6.6.1

Supporting Info

I manually resolved the issue by running SQL queries to replace the old URLs in the database. Here’s an example of the SQL I used:

UPDATE wp_options SET option_value = REPLACE(option_value, 'wpdistrib-v661', 'wpdistrib-v662') WHERE option_value LIKE '%wpdistrib-v661%';
UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, 'wpdistrib-v661', 'wpdistrib-v662') WHERE meta_value LIKE '%wpdistrib-v661%';
UPDATE wp_posts SET guid = REPLACE(guid, 'wpdistrib-v661', 'wpdistrib-v662') WHERE guid LIKE '%wpdistrib-v661%';
UPDATE wp_posts SET post_content = REPLACE(post_content, 'wpdistrib-v661', 'wpdistrib-v662') WHERE post_content LIKE '%wpdistrib-v661%';

Local Log file attached as requested.


With the Local Log file attached to your submission, this should provide enough information for the LocalWP team to investigate the issue.

Let me know if you need further adjustments or help submitting!
local-lightning.log (143.6 KB)

Hi @wpdistrib

As a test, with the plugin removed if you clone a site do you run into issues with domains not updating or is it only occurring when the plugin is present?

Hi,
It can only be related to the plugin because the non-migrated URLs are all displayed within the White Label CMS extension. So, could this be a coding issue within White Label CMS?

It seems like it is plugin-specific, in which case it could be tough for us to investigate and resolve as we aren’t able to accommodate all third-party products available out there. You might try consulting with their developers or documentation to see if any other users have experienced this or if they have any recommended workflows.

I thought the same, that the WhiteLabel extension might not adhere to database standards. However, plugins like Updraft Plus handle migrations with this plugin without any issues. Wishing you all the best!

Is this the plugin in question @wpdistrib?

yes ! this one

Okay thank you for confirming @wpdistrib! I’ll pass this along to the Devs and we’ll keep an eye on this for addressing in a future release.