0

I'm trying to make a copy of my live site that is running an old version of Wordpress to my local server, but I'm not sure how to go about this. I followed this tutorial, but when I go to http://localhost/wordpress I get a 404 error saying, "The requested URL /wordpress/ was not found on this server." Could someone help me out please?

2
  • this is a permission or web server configuration problem that is not related to WP. are you sure you have php installed and configured? Commented Jul 7, 2016 at 20:04
  • @MarkKaplun yeah, I installed everything to MAMP/htdocs directory
    – Grady
    Commented Jul 7, 2016 at 20:22

2 Answers 2

0

Here are the steps I do when I copy a Wordpress site (old/new version, live or local).

  1. Download all the wp-content/ directory and replace the files (nothing else)

  2. Rename the wp-config-sample.php in wp-config.php and adapt the environments variables to your new environment (database name, database user, database password...)

  3. Download the database's content as a .sql file and import it in your new environment

    1. Run this SQL commands in your new database to update ALL the urls (site, posts, attachements...) : https://wpbeaches.com/updating-wordpress-mysql-database-after-moving-to-a-new-url/

That should work fine once all these steps done.

2
  • So should I download the version the website is using, and replace the wp-content directory in that wordpress installation with the live website's wp-content directory?
    – Grady
    Commented Jul 7, 2016 at 20:16
  • yup if you want a copy, that's an important step.
    – 2Fwebd
    Commented Jul 8, 2016 at 9:07
0

In the Wordpress settings, there are 2 locations to enter the WP site's URL. (See screenshot.) These are also stored in the wp_options table of the wordpress database. If they do not match the URL of your new server (in your case, 'localhost'), then you will get an error like this.

enter image description here

If you can't access the settings page (because wordpress won't load), then you'll have to edit the first two fields of the wp_options table.

3
  • Yeah I couldn't access anything when I went to the URL. I ran a SQL query to change the old URLs to the new one but it didn't work either.
    – Grady
    Commented Jul 7, 2016 at 20:21
  • What is your environment? For my localhost, I use MAMP, so I have to make sure the preferences point to the 'wordpress' folder. Otherwise, I get the 404 error.
    – scott
    Commented Jul 7, 2016 at 21:33
  • Yeah I use MAMP as well. Not sure what you mean by the preferences pointing to the wordpress folder, but my document root is htdocs, which the wordpress folder was in.
    – Grady
    Commented Jul 8, 2016 at 13:24

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.