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?
Here are the steps I do when I copy a Wordpress site (old/new version, live or local).
Download all the wp-content/ directory and replace the files (nothing else)
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...)
Download the database's content as a .sql file and import it in your new environment
- 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.
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.
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.