0

I'm having an issue with a local copy of a live WordPress site. The local site itself http://localhost/mywordpress/ works as I did the following:

  • 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;
  • update wp_postmeta, setting meta_value to replace http://www.example.com with http://localhost/mywordpress 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 http://localhost/mywordpress/wp-login.php produces a 403 error message.

To get around this, I copied the code to a wp-login2.php, and I can see the page without issue. However, upon submit, I get redirected to the production site. Seeing this, I thought that maybe changing the instances of wp-login.php to wp-login2.php would help, but same issue occurs, except that the page is a 404 since it doesn't exist in production.

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

I apologize for the overload in details.

Added detail, when accessing http://localhost/mywordpress/wp-admin/, I get redirected to the production site.

0

2 Answers 2

3

It is painful to clone the wordpress site sometimes when the site has a lot of plugins and custom code.

I did it manually before. But I am using "Duplicator" plugin to handle this now.

Please check: https://wordpress.org/plugins/duplicator/

5
  • The backups are scheduled on the production site using BackupWordPress plugin, and I'm trying to import the backup files into a staging server running XAMPP.
    – Just Rudy
    Commented Feb 19, 2016 at 13:48
  • Will this take care of the naming changes when cloning to a local server?
    – Just Rudy
    Commented Feb 19, 2016 at 22:23
  • It will take care the changes of the domain or the path.
    – Alex Poon
    Commented Feb 20, 2016 at 3:04
  • Thanks @AlexPoon. 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, 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.
    – Just Rudy
    Commented Feb 22, 2016 at 17:24
  • Sorry, disregard. I fat-fingered the db update to point to links that do not exist.
    – Just Rudy
    Commented Feb 22, 2016 at 17:47
0

For me, it turned out to be a plugins issue. So I ran the following query:

update wp_options set option_value = 'a:0:{}' where option_name = 'active_plugins'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.