Wednesday, January 16, 2019

Manully Moving WordPress Site to Localhost

  1. FTP the files to your localhost directory.
  2. Import the the MySQL dump of the live site.
  3. Change the “wp-config.php” file settings to reflect your new hosting information.
  4. Lastly run the following SQL statements to update links in the database.

UPDATE wp_options SET option_value = replace(option_value, ‘http://www.example.com’, ‘http://localhost/test-site’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

UPDATE wp_posts SET post_content = replace(post_content, ‘http://www.example.com’, ‘http://localhost/test-site’);

UPDATE wp_postmeta SET meta_value = replace(meta_value,’http://www.example.com’,’http://localhost/test-site’);

The first update command didn’t work for me. I believe the person who set up the changed the default home page to be something else. I fixed this by going into the database, and under the table wp-options I was able to set this manually. I then logged into the back-end of the site and under Settings >> General. I manually typed in my localhost address in the “Site Address (URL)” field.

I found the following link that helped me out.

http://www.wpbeginner.com/wp-tutorials/how-to-move-live-wordpress-site-to-local-server/

I hope this helps someone else out there….

0 Comments

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>