Pulling site to Local (Lightning) not changing live site domain to local site domain

When pulling my live site (hosted on Flywheel) to my Local (v5.4.2) environment, the process says it’s changing the site domain, but only updates the hosts file. The ‘siteurl’ and ‘home’ options in the database (wp_options) still have the live site domain names.

Because of this, when I click on the ‘Admin’ or ‘View Site’ buttons in Local I end up getting connected to my live site instead of the local development site. I have to manually change these two entries in the local database just so I can view/administer my local site.

I have tried creating the local site environment by pulling from the live site, and I also see the exact same problem if I imported the local files from the older Local by Flywheel app and then did a pull from the live site.

Isn’t the pull process supposed to update the local database with the correct local site domain?

(Running on Windows 10 [1909])

Thanks.
Doug

Hi, I have the same issue on Mac OS as well. with 5.5.2.
How and where did you change the Admin and View site button entries in the local database ?
Thank you.
Regards.

NEW UPDATE: Installed Local v5.5.2 on fresh Ubuntu 20.04 installation. Pulling production site to local still fails to properly update the site domain for the local development site (just like in Windows).

Both Windows and Linux versions show an orange warning at the top of the screen that says “Warning! This site’s Wordpress URL settings do not match the host set in Local.” If I press the “Fix It” button, it acts like it is trying to fix the problem, but eventually the warning reappears and the database has not been fixed.

Same thing with me on the last Mac Os version update.

If Local is having issues updating those urls, that makes me think that something is causing a conflict and preventing Local from doing a search-and-replace.

A couple of things to verify:

  1. Is the Local site’s domain local one? So for example, the local site should use example.local when the remote site is using example.com
  2. Are there any errors within the Local log that point to issues with doing the search and replace?
  3. Is the table prefix that is set within the wp-config.php file different than the table prefix that is actually used within the database?

If you’d like to attach your Local log, the community can take a look and see if we spot anything! See this Community Forum post for instructions on how to get that log:

Ben, here is the local’s log.
FYI, I made the update with 5.5.3 for Mac, and it’s getting worse. This time, it’s not possible to import a website…The popup error message is : certificate is expired.
Regards.

local-lightning.log (4.3 KB)

@ELCHE60,

Sorry for the trouble importing! This should be resolved now. See 5.5.3 for Mac Os : Certificate has expired for more details.

Hi, concerning the certificate expired, this is fixed. Thanks.
However, still having issues about trying to get to local site domain.
When importing a web site, I have this following message :
" The following SQL files failed to import : */app/sql/dup-database_72c98ad-31085855.sql
Please double-check that the site looks correct after importing".

Once clicked on the “Ok button”, there is this orange banner stating :
“Warning : this site’s wordpress URL settings do not match the host set in local”.

After clicking on the “fix it” button, the app tries to change the domain for ages…
So I had to quit the Local App.

Please find attached the local lighting log file.
Regards.
local-lightning.log (20.7 KB)

That error seems to point to there being extra sql files within the backup and which might be interfering with things.

Can you try unzipping the site archive and remove the dup-database_72c98ad-31085855.sql file, then re-zip the folder and try importing?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.