views:

1218

answers:

3

I have MAMP set up on my iMac and on my Macbook. I want to keep both installs synced using dropbox. When upgrading MAMP the only 2 folders you need to transfer are 'db' & 'htdocs'. My theory is then that these are the only 2 folders I need to keep in sync. Sound right to you so far?

Syncing the 'htdocs' folder is easy as you can put it in your dropbox and point the MAMP preferences to the dropbox folder, but the 'db' folder has no such option.

Any suggestions on how I could keep the 'db' folder synced? Thanks.

A: 

Ok, so I am thinking that my solution is going to have to be a combination of chronosync http://www.econtechnologies.com/site/Pages/ChronoSync/chrono_overview.html & dropbox.

Have a copy of cronosync on both the macbook and the iMac then before starting work on either machine manually run chronosync to sync the MAMP 'db' folder with the dropbox 'db' folder.

Unless someone out there has a better idea. Thanks.

portalpie
A: 

Do you have to keep the database's binary data files synchronised?

I assume this is for development, for which I would recommend using a "proper" version control system (Like http://www.selenic.com/mercurial/wiki/">git, darcs and so on), but this should apply to using Dropbox or any other file sync tool..

Just synchronise the code as usual, but export your database schema and some testing data into a regular file (probably as a .sql dump from MAMP's included phpMyAdmin tool), and keep that synchronised. Since it's a regular file, you shouldn't have any problems.

You could write a small script that wipes the database and populates it with the schema file, and one that does the opposite (dumps the database to a file).. Before you start working, you run the importdatabase script. Once you're done, you run the dumpdatabase script.

Basically, export your database to a .sql file, synchronise that.

The other options are just to sync the entire MAMP folder (although it is pretty big), or to move the db folder to DropBox's folder, and symlink the /Applications/MAMP/db/ to here (using the command ln -s /Applications/MAMP/db/ /Volumes/DropBoxFolder/db/ - creating an alias in Finder doesn't seem to work the same, annoyingly..)

dbr
Thanks.I have had a play with this a bit, but I am not sure I know enough to effectively implement some of these suggestions. Tried the symlink think but it didn't seem to work. No doubt I am doing something wrong. I am going to try setting up my own version server at home in time.
portalpie
A: 

What I ended up doing was putting my hotdocs folder into my dropbox and changing the path in MAMP to the dropbox version. I than asked a friend to set up a few mysql remote databases for me. This combination has been working great. I have to use Sequel Pro to access the database which is a nice app. I was originally hoping to use myphpadmin or learn the terminal but those features were not available on my mates server. Hope this helps someone else.

Dropbox has such a small lag too that I have even found myself coding on one comp and refreshing on another comp. Dropbox is worth finding uses for.

portalpie