• How to secure your MAMP files with Dropbox

In this post I will describe the setup I use with Dropbox to secure all my important MAMP data.

Background: I like to have my MAMP and development environment backed up in case of getting a new computer, my hard disk crash, or anything happens to the data. I can get right back to where I left. It is not a good idea to just put the whole MAMP directory on Dropbox, because you would not want to back up temporary files. I do want to back up binaries, MAMP itself, and any files I need to actually start MAMP on a different computer.

Prerequisites:

  • Dropbox installed
  • MAMP installed

Notes:

  • This does not work if there is several different users using the same MAMP installation.
  • Some locked files might be attempted to be synced, though I haven’t experienced it causing any issues.

Setting up MAMP on Dropbox

Remember to turn off MAMP before doing this.

In the terminal, run the following commands:

$ cd /Applications/MAMP
$ mkdir ~/Dropbox/MAMP
$ mv bin cgi-bin conf db htdocs Library MAMP.app ~/Dropbox/MAMP/
$ ln -s ~/Dropbox/MAMP/* /Applications/MAMP/

Start MAMP again (remember to use /Applications/MAMP/MAMP.app). Now all your valuable data is saved to Dropbox!

When you need to install on a new system

Make sure that Dropbox is installed first, and you got all files synced completely to your computer. Now just install a fresh version of MAMP (preferable the same version as you have in dropbox), and run the following commands:

Remember to turn off MAMP before doing this.

$ cd /Applications/MAMP
$ rm -r bin cgi-bin conf db htdocs Library MAMP.app
$ ln -s ~/Dropbox/MAMP/* /Applications/MAMP/

Again remember to use the symlink /Applications/MAMP/MAMP.app to start it.

Upgrading MAMP

Upgrading MAMP on Dropbox is no different from upgrading MAMP regularly. You just have to overwrite the files in your Dropbox folder instead. The instructions would look like this:

  1. Rename the current program folder MAMP to MAMP_OLD

  2. Load the installation image of MAMP from http://mamp.info and open it

  3. Drag the MAMP folder from the installation image to your “Applications” folder (Edit: Note that with the newer MAMP 2.2 it is a pkg installation process)

  4. In the terminal run the commands:

    $ mv ~/Dropbox/MAMP ~/Dropbox/MAMP_OLD
    $ mkdir ~/Dropbox/MAMP
    $ cp -r ~/Dropbox/MAMP_OLD/db ~/Dropbox/MAMP_OLD/htdocs ~/Dropbox/MAMP/
    $ cd /Applications/MAMP
    $ mv bin cgi-bin conf Library MAMP.app ~/Dropbox/MAMP/
    $ rm -r db htdocs
    $ ln -s ~/Dropbox/MAMP/* /Applications/MAMP/
  5. Check whether all data has been transferred correctly, you might want to transfer certain config files, recompile extension, etc

  6. The /Applications/MAMP_OLD and ~/Dropbox/MAMP_OLD folder can now be deleted. You may however keep it, so you can fall back to your original setup

The Author

Dan Schultzer is an active experienced entrepreneur, starting the Being Proactive groups, Dream Conception organization, among other things. You can find him at twitter

Like this post? More from Dan Schultzer

Comments? We would love to hear from you, write us at @dreamconception.