• Resolved rudym

    (@rudym)


    Hi all,

    I’m having an issue with a local copy of a live WordPress site. The local site itself “https://localhost/mywordpress/” works, but when I try to access the wp-login.php page, it redirects me to the production site. I do the following under a local XAMPP setup:

      copy the production WP folder;
      import the MySQL database to the local db with the same credentials as production (I’ve already created the local db and username same as production);
      update the ‘home’ and ‘siteurl’ to localhost in wp_options;
      delete the wp-config.php file so that I can set up the configuration manually;

    Upon the setup, I am able to view the site’s homepage, but accessing https://localhost/mywordpress/wp-login.php redirects me to the production site as well as accessing https://localhost/mywordpress/wp-admin/.

    When clicking on other links on the homepage, I get redirected to the XAMPP dashboard page. This despite the link addressing to https://localhost/mywordpress/somelink/

Viewing 3 replies - 1 through 3 (of 3 total)
  • You’ll need to replace the database entries of every mention of your production server name to localhost for links to resolve correctly!

    “Moving WordPress” guide <https://codex.www.ads-software.com/Moving_WordPress&gt; suggests 3 ways:

    1. Use the Better Search Replace or Velvet Blues Update URLs plugins if you can access your Dashboard.
    2. Use WP-CLI’s search-replace if your hosting provider (or you) have installed WP-CLI.
    3. Use the Search and Replace for WordPress Databases Script to safely change all instances on your old domain or path to your new one. (** only use this option if you are comfortable with database administration ** )

    Thread Starter rudym

    (@rudym)

    UPDATE:

    Ok, so what I did finally was disable all plugins via MySQL:

    update wp_options set option_value = ” where option_name = ‘active_plugins’. The site is up and I’m able to log in. However, when I try accessing ‘https://localhost/mywordpress/some_link&#8217;, I get redirected to the XAMPP dashboard. Any suggestions? I’m checking the permalinks, but nothing stands out for me as ‘post name’ is selected.

    Thread Starter rudym

    (@rudym)

    Disregard. My solution was indeed to disable all plugins via mysql update, but I had also fat-fingered one of the updates to post links to pages that don’t exist. All clear now. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help with WordPress local copy from production’ is closed to new replies.