I created a new wordpress site in local. Went into it in local and restored the backup of the live site. Now wheneve I access admin it goes to the live site NOT the local install. I edited the wpconfig.php adding
define(‘WP_HOME’,‘http://domain.local’);
define(‘WP_SITEURL’,‘http://domain.local’);
now it says server no found. Can someone tell me where I have gone wrong?
Can you check that the hosts file contains an entry like
…
192.168.95.100 http://domain.local #Local Site
…
I used the wp cli search and replace which bypassed the existing
database settings and didnt require me to actually access the
site.
I’m in now.
Fantastic, you know it’s great if you could share the code you ran after using the SSH to get into the machine.
Can you explain how you did this? I am having the same issue.
Thank You!
@MalekaVrana from the primary LbF window, right-click or control-click on the project. You will see a menu that has ‘Open in SSH’ or similar.
I did this wp search-replace ‘//mydomain.com’ ‘//mydomain.local’
hth
I did this wp search-replace ‘//mydomain.com’ ‘//mydomain.local’
hth
@afragen and @patbell101 thank you for your patience and help. I am entering (with my domain info) the
wp search-replace ‘//mydomain.com’ ‘//mydomain.local’
into the SSH and press enter and I get root@41fee52e338d:/# (and then nothing happens).
When I go to “View site” I am taken to the live site. When I go to “admin dashboard” I am taken the mydomain.local but I get a 404 page not found
Try the following.
wp search-replace --url=site.company.com site.company.com sitedevl.company.com --precise
@afragen, thank you. I think I am still doing it wrong. This is what mine looks like
wp search-replace --url=site.corvusjanitorial.com site.corvusjanitorial.com sitedevl.corvus-janitorial.local --precise
Is the domain site.corvisjanitorial.com
?
You probably need to amend the command to
wp search-replace --url=corvusjanitorial.com corvusjanitorial.com devl.corvus-janitorial.local --precise
@afragen - The domain is corvusjanitorial.com
Am I putting the code in the correct spot? I put it at the bottom of the SSH existing code? When I press enter I get this root@41fee52e338d:/#support
Sorry I’m not certain. I hope someone more adept with WP-CLI search-replace can assist.
I ended up migrating the site to FlyWheel (for the 2 week free trial) and then pulling that site to Local. Total work around but it worked.