Recently I struggled a little with un-publishing my public WordPress Blog to a local MAMP environment, for local testing purposes before I apply big changes (as it should be). There are actually only some minor things to consider, in order to properly get a WordPress installation running locally.
-
- Install MAMP (Mac Apache, MySQL & PHP) and start it *
- Download all WordPress files into MAMP’s /htdocs/ folder (or a subfolder to it, f.eg. “/htdocs/blog/”)
- Now gather the MySQL database data of your Blog and import it into the MAMP-MySQL Server
(I love using Sequel Pro for this job, login is directly to the socket with U: & P: “root”)
- After the successful Database-import, open the table “wp_options” and find the line with option_name “home” – adjust it to your local IP with MAMP’s Apache Port (default: 8888)
(it’s important you use the IP address and not values like “localhost” or “my-computer.local” – check the official MAMP forum here for the reasons)
- Do the same for the option_name “siteurl”
- As a last step, you have to change the configuration file of your WordPress installation – therefore open the file named “wp-config” from your MAMP /htdocs/ folder and adjust the database connection information to match your MAMP MySQL Server.
- That’s it – you should now be able to connect to your Blog via http://localhost:8888/
* If MAMP won’t start it’s MySQL Server, use the Terminal command
sudo mysqld -9 killall
and try to start it again… (Source)