B7th
B7th

Reputation: 664

How to sync Mamp's mysql data folder to Dropbox

I use Mamp and recently (yesterday) I lost, apart from a two weeks old backup, all of my databases due to a unwanted disk wipeout. !kcuf

Coding is more or less intact as I moved the apache code under a dropbox folder.

So my question is, just in case it happens again, how can I sync Mamp's databases to Dropbox?

Upvotes: 0

Views: 2488

Answers (1)

B7th
B7th

Reputation: 664

Source : Syncing MAMP with Dropbox

  • Open terminal and type the following commands:
  • A: cd ~/Dropbox/localfolder (opens the directory to put the database in)
  • B: cp -r /Applications/MAMP/db dbfolder (copies it into a new folder within)
  • C: rm -rf /Applications/MAMP/db (remove the database from MAMP folder)
  • D: ln -s ~/Dropbox/localfolder/dbfolder /Applications/MAMP/db (creates a direct link for MAMP without getting hands deep in coding)
  • Start up MAMP (If already started, just restart as it will then get the new MySQL route)
  • Feel much more secure

If it is already synced but somehow your Mac went all Windows on you*, Reinstalling Mamp and Dropbox and doing steps C and D will do the job.

By the way, in order to make Dropbox the location of your Mamp locals, move your all of your files to the folder of your choice and, starting Mamp, go to preferences, Web server, and Document root to change it to the new one.

Saves on recoding big deal.

*Not intended seriously here

Upvotes: 1

Related Questions