MAMP Pro to the cloud

After my my Mac decided to fuck up after installing Sierra, it gave me a chance to reorganise my shit as I forgot to backup my MAMP Pro installation, so I had to rebuild all 20+ web sites and databases from scratch. Not doing this again as it’s a right pain in the ass.

So after playing around a bit, I’ve moved the htdocs folder and the MySQL databases to Dropbox. I could use iCloud but I’m not installing that shit on my Workstation PC at home.

Before we go to Terminal, make sure MAMP and your MySQL management tool (phpmyadmin/Sequel Pro/Workbench) of choice is closed.

Copying the databases

If you want to use another cloud storage solution, here are the default install path for iCloud:
~/Library/Mobile\ Documents/com~apple~CloudDocs/

Google Drive:
~/Google\ Drive/

Microsoft OneDrive:
~/OneDrive/

Just replace the Dropbox path in these examples. So let’s copy the databases folder to Dropbox in a folder called MAMP_db.

cp -r /Library/Application\ Support/appsolute/MAMP\ PRO/db ~/Dropbox/MAMP_db

Rename the default folder to something else

mv /Library/Application\ Support/appsolute/MAMP\ PRO/db /Library/Application\ Support/appsolute/MAMP\ PRO/delete_db

Create a symbolic link to the new folder.

ln -s ~/Dropbox/MAMP_DB /Library/Application\ Support/appsolute/MAMP\ PRO/db

Now start MAMP Pro and wait to see if MySQL loads without errors. I double checked by loading Sequel Pro to see if my databases were there.

If you want to use iCloud instead, use

If that was a success, we can now move the web sites.

Copying the htdocs

Exactly the same commands, just a different folder.

cp -r /Applications/MAMP/htdocs ~/Dropbox/MAMP_htdocs
mv /Applications/MAMP/htdocs /Applications/MAMP/delete_htdocs
ln -s ~/Dropbox/MAMP_htdocs /Applications/MAMP/htdocs

Load MAMP Pro and click localhost and hey presto.

I did this on a fresh installation, and when tried to access localhost I got a Forbidden 403 error. All I did was make a new host and it worked fine.

Is your WordPress site running slow on an IIS server?

I’ve been working on an internal IT support board and after moving it from the local test server to a remote live server sending the URL out for test, we noticed how damn slow it was, for example, it was taking 10 seconds on every page to connect to a clicked link.

As it was Active Directory secured, changing it to the local AD controller to the server didn’t speed it up as much as I had hoped.

Someone then suggested changing the DB_HOST in the wp-config.php to 127.0.0.1 instead of localhost.

facepalm-single

Much to my amazement, the 10 second delay disappeared in an instant. So there you go, a quick fix to the problem and another reminded why I hate using IIS!