Local Site redirecting to Live Site after Backup Restore

What issue or error are you experiencing?

I recently restored from backup using TotalUpkeep. We’ve done this many times before to keep the Local version up-to-date with the Live Site. It has always worked.

This time, however, after the restore, when attempting to visit the local site, it redirects to the live site.

The local site works when visiting the wp-login page (it is a custom link), but once logged in, it immediately redirects to the live site. Same thing when attempting to visit the home page. When visiting other pages, it works fine, however the assets do not load correctly due to the THEME_DIR; variable incorrectly loading the live site theme directory:

<?= THEME_DIR; ?>/assets/gif/premium-workspace-mockup-a.gif

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc

I’ve followed the steps explained here: Flywheel Local Site Redirects to Live Site

(wp search-replace and changing the wp_options table)

System Details

  • Local Version:

Version 8.2.1+6583

  • Operating System (OS) and OS version:

Mac OS Sonoma Version 14.2.1 (23C71)

Local Logs

Attach your Local Logs here (Help Doc - Retrieving Local’s Log)

local-lightning.log (42.7 KB)

Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Also noticing functions like <?= get_permalink()?> return the live site

Update: The local wp_config file is identical to the live site. Changing WP_HOME and SITEURL here had it working briefly, but now it is extremely slow. The obvious place to think is that the restore caused this issue. Does Local recommend a plugin to restore/backup in this way? I was doing this periodically to keep the local version synced with the live version. Obviously this is not the best method.

Update: Waited for it to load then disabled unnecessary plugins. Site is working fine

Hello @willbeing -

Thank you for letting us know what worked for you!

Happy Building! :green_heart:


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