Let me start out by saying I love ExpressionEngine. Developing on it is a real joy. One of the hurdles I ran into though was the times that I wanted to step away from my desktop and develop elsewhere. Be it a coffee shop or a requirement of a contract to be onsite for a period of time. I would do some work on my laptop, then want to go back to my desktop.
My original workflow looked something like:
- Work on something remotely.
- Go into PHPMyAdmin.
- Export my database.
- Reimport it to my desktop.
Then the reverse when I wanted to go back.
It just got so tedious that I stopped taking my work anywhere with me.
I started digging into MAMP a bit and found out how the file structure worked for the mySQL that it uses. That was what I needed. So I got myself a USB flash drive and started working.
This in theory could work with a cloud service like Dropbox or MobileMe but I did not want to worry about syncing issues and data corruption.
Make sure you have closed MAMP or MAMP PRO before starting!
Step 1: Prep the USB Drive.
One of the things that took me the most time was figuring out why MAMP could not initialize the mySQL files on the USB Drive. The secret is enabling permissions on the drive itself. Which by default (I did not know) is not enabled.
Now I started out with a clean slate by formatting my USB Drive as Mac OS Extended (Journaled). I also went and bought a OCZ Rally2 Turbo 4gb Thumb Drive on Amazon once I proofed the concept. Wow, needless to say I am very impressed. It’s almost as responsive as the hard drive.
So once you have the USB formatted and ready to go:
- Insert the USB Drive (if it is not already).
- Right click on the drive either from the desktop or the finder menu.
- Select “Get info”.
- At the very bottom of the info window uncheck “Ignore ownership on this volume”.
Step 2: Copy the mySQL assets.
- If you are using MAMP: Navigate to /Applications/MAMP/db/.
- If you are using MAMP PRO: Navigate to /Library/Application Support/living-e/MAMP PRO/db/.
- Right click and copy the folder /mysql/ to your USB Drive.
- Rename the original folder to /mysql-old/ as a backup.
- If you are using MAMP: Open Terminal and run: “
ln -s /Volumes/your USB Drive name/mysql/ /Library/Application\ Support/living-e/MAMP\ PRO/db/mysql” - If you are using MAMP PRO: Open Terminal and run “‘ln -s /Volumes/your USB Drive name/mysql/ /Applications/MAMP/db/mysql’”
- If the terminal command was successful you should just receive another command prompt.
- If it was not successful check to make sure your folder locations were correct.
Thats it.
Simply reopen MAMP and start the servers.
- When you are done on that machine, stop the MAMP servers and eject the USB Drive.
- Insert the USB Drive on the other computer.
- Restart MAMP and pickup where you left off.
Note: Remember this will not sync your files for you unless you have it setup to reference your USB Drive for the project assets (html, image, etc.) as well. You could also use a versioning system like Git or SVN.I wanted to set this up for my bus ride so I made sure the files are being referenced right on the USB Drive itself. That way it has no dependents on the internet.
blog comments powered by Disqus