Setup and Migration of a WordPress local dev site using MAMP Pro
How to set up a local WordPress dev site on your Mac, publish it from your machine, then migrate it to the production server using MAMP Pro and Dyn.
(If you’re going from a live site to a local dev site, read this instead)
Setup in MAMP Pro
1. Setup in MAMP Pro for dev and web sharing
- Set user permissions to www
- Set IP address to machine’s static IP as defined in your Linksys router/connectivity/local network/dhcp reservations
- Set port to 80
- Turn on Dyn Dns in Mamp Pro
- Install Wp into created local domain
- Develop the site
2. To take your dev site live from MAMP
Set up your router with a static IP for your local machine and port forwarding to let incoming traffic on Port 80.
Static IP
- In your Linksys Router’s admin, reserve a DHCP address for your machine.
- In the Connectivity/Local Network tab, hit the DHCP reservations button and click the checkbox next to your machine. Click “Save.”
Port Forwarding
- (Works on newer routers with Smart Wifi)
- Go to Security/Apps and Gaming tab/ Single Port Forwarding (button)
- Application Name – whatever you want. I chose “MAMP.”
- External and Internal port – both 80
- IP address – enter it, same as your DHCP reservation. Click save.
->Don’t use the DYN tab in the router.
Although you could set up DYN in the router and not in MAMP Pro – it’s either/or – Port Forwarding is simpler, and the success of this tutorial depends on it. Just remember to turn it off in the router (and/or shut down MAMP) when you’re not showing the site to your client. I use Little Snitch for outbreaks of security paranoia, to monitor traffic in and out of my Mac.
Get your ISP and Dyn working
Look at these options above and verify them
- Make an alias domain in Dyn.com account, picking from their options
- Open port 80 in your ISP (mine is Optimum). Ask them how if you can’t find it. You may need to upgrade your account to permit it.
- Add Dyn alias to your dev site instance in MAMP and turn on Dyn server in MAMP options
- My Linksys router already has port forwarding set up (security/games tab). Set it up if yours is not – follow the tut for your router in Dyn’s support pages – they have specific support for Linksys.
- Use Dyn port checker via its support/wizard. Should be all set.
Use the Dyn domain url for remote access, while continuing to use the MAMP Pro domain url for local access.
***Add Relative URL plugin to WordPress install***– otherwise you’ll lose the connection to your css for remote viewers.
3. Migrate to new server:
- Create new DB, user, pw on target server
- find or confirm sql hostname in target server cPanel info
- Export db from dev site using WP Migrate DB, changing to live url, **including // but not http:** in the plugin’s url options
- Change admin pw if necessary
- Copy config.php on local server and change database connection details to match the ones created in steps 1 & 2
- FTP the site files over to the new public_html or whatever your designated new directory is on the new server
- Overwrite config.php with your file from step 3
Here are 2 valuable tutorials: