I’m helping a friend out with her small site and I was trying to set up a copy of the site to test certain updates locally (including a PHP update from 5.2 to 5.6), but the links are all broken; I can only get the homepage to load. I’m guessing it’s something really simple that caused the links to break, but I’m rather inexperienced with WordPress so I’m not sure where to start.
I ran this SQL command that replaced the URL with the local one, so I’m not sure if that somehow broke the links (some links aren’t broken):
SET @oldsite='http://oldsite.com';
SET @newsite='http://newsite.com';
UPDATE wp_options SET option_value = replace(option_value, @oldsite, @newsite) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET post_content = replace(post_content, @oldsite, @newsite);
UPDATE wp_links SET link_url = replace(link_url, @oldsite, @newsite);
UPDATE wp_postmeta SET meta_value = replace(meta_value, @oldsite, @newsite);
I exported the database manually via phpMyAdmin, imported it via Local’s Adminer, and then used Updraft Plus to grab the “themes”, “uploads”, “plugins”, and “others” folders it generates to copy them over to the site on Local.
Thanks