I've seen waaaay too many people modifying their Wordpress sites live, which is fragile because when (not "if") you break something, your visitors will see it. Here are steps for setting up a copy of your site locally, so you can muck around without worry. These instructions are for Wordpress sites hosted on GoDaddy specifically, but they should be fairly easy to interpret for other providers.
- Log into GoDaddy, and go to "My Account".
- Under "Web Hosting", click Launch next to your site's name.
- Under "Databases", click "MySQL".
- Next to your database name, click "Actions"->"Back Up".
- Log into FTP, and under
/_db_backups/
you'll see a new*.sql
file. - Rename this to be
mydb-YYMMDD.sql
format (e.g.superwordpress-130220.sql
).
-
Copy all files from FTP to
$HOME/Sites/mysite/
(e.g./Users/aidan/Sites/superwordpress/
). -
Install and and open the MAMP application.
-
In the MAMP control panel, click "Start Servers". You should see the circles next to "Apache Server" and "MySQL Server" slowly turn green.
-
Go to "Preferences"->"Apache" and set your "Document Root" to be the directory that contains your Wordpress files (e.g.
/Users/aidan/Sites/superwordpress/
, though it may be a subdirectory... look forwp-config.php
). -
From the MAMP start page, go the "phpMyAdmin" tab, and under the "Databases" tab, fill in the field under "Create database" with your database name (e.g.
superwordpress
) and click "Create". -
Click your database name in the left sidebar.
-
Go to the "Import" tab, click "Choose File", select the most recent
*.sql
file from_db_backups/
(e.g./Users/aidan/Sites/superwordpress/_db_backups/superwordpress-130220.sql
), and click "Go" at the bottom of the page. -
Go to the "SQL" tab and paste the following in the text area, then click "Go" at the bottom right.
UPDATE wp_options SET option_value='http://localhost:8888' WHERE wp_options.option_name IN('home', 'siteurl');
-
In the
wp-config.php
file, change the values ofDB_USER
,DB_PASSWORD
andDB_HOST
to look like the following:/** MySQL database username */ define('DB_USER', 'root'); /** MySQL database password */ define('DB_PASSWORD', 'root'); /** MySQL hostname */ define('DB_HOST', 'localhost');
-
Visit
http://localhost:8888
, and you should see your site!
DO NOT UPLOAD wp-config.php
WITH THESE CHANGES.
In wp-config.php
, change the value of WP_DEBUG
to be true
. It will now overlay your page with error messages...which you should fix.