3 minutes reading time (622 words)

Sync Joomla! websites with MAMP and Dropbox on your Macs

Sync Joomla! websites with MAMP and Dropbox on your Macs

If you’re anything like me, the confines of 4 walls is unpalatable. So you opt for working at the local coffee shop, book store or even the beach where there are signs of life other than your own pulse. But how can we do that when our work is so dependent on having an internet connection? Simple. With a couple of Macs, three apps and about an hour, you can cut the cord — the Ethernet cord that is.

What you’ll need:

Preparing your directories for syncing Joomla! files on your first machine:

  1. Install MAMP (or optionally MAMP Pro)
  2. Install Dropbox: when prompted, choose to change the location of the Dropbox folder. Place the folder in /Users/Shared rather than a specific user.
    “Why,” you ask, “should I put it in the Shared folder rather than the user folder?”
    There is a very good reason for it. The path will be used in Joomla’s configure.php file so the path needs to remain consistent whether you are working one Mac or another. If you use two different usernames, naturally that would be a problem; the path would work on one machine and not the other. You can always opt to create a user that is named exactly the same on all of your machines.
  3. Now that you have your Dropbox folder, create a directory inside of it for site files. I use _sites, but you can name it whatever you'd like.
  4. Now open MAMP and click the “Preferences” button. Go to the Apache tab and change the document root to: /Users/Shared/Dropbox/YOUR-SITE-DIRECTORY/.
    (In MAMP Pro, change you disk location to: /Users/Shared/Dropbox/YOUR-SITE_DIRECTORY/.) If you don't see the Disk Location box, look at the top left and make sure you are on the Hosts tab rather than the Server tab.

Preparing the databases for syncing on your first machine:

  1. Download and install SymbolicLinker 2.0
  2. Create db directory in Dropbox directory. I use _db. You can name it whatever you'd like.
  3. Ctrl + Click (or Right Click if you have that option) on the db directory you just created in Dropbox and choose “Make Symbolic Link”.
  4. Open a finder window and go to: Applications/MAMP/db. Copy the contents of the MAMP db directory to the database directory you made in your Dropbox.
    (In MAMP Pro, the databases are in a different directory: /Library/Application Support/appsolute/MAMP PRO).
  5. Delete the /db directory in /MAMP directory
    (In MAMP PRO /Library/Application Support/appsolute/MAMP PRO).
  6. Move db symbolic link you have created to /MAMP 
    (In MAMP PRO /Library/Application Support/appsolute/MAMP PRO).
  7. Rename the Symbolic Link to: db (the same name of the MAMP db directory you deleted).

And finally, let's sync those other machines…

  1. Repeat steps 1-2 and 4-5 on your other Mac(s). You can skip step 3 because you already created the directory in Dropbox and it will automatically sync.
  2. Ctrl + Click (or Right Click if you have that option) the database directory you already created in Dropbox when setting up your first machine and choose “Make Symbolic Link”.
  3. Open a finder window and go to: Applications/MAMP/db. Delete the MAMP /db directory. 
    (In MAMP Pro, delete the /db directory in: /Library/Application Support/appsolute/MAMP PRO).
  4. Move the Symbolic Link for the database directory from your Dropbox directory to: Applications/MAMP/
    (In MAMP Pro, move it to: /Library/Application Support/appsolute/MAMP PRO).
  5. Rename the Symbolic Link to: db
  6. Create your database with phpMyAdmin
  7. Add Joomla! files to your new website directory in Dropbox and install Joomla! as you normally would.

Done. Dropbox needs a few minutes to sync depending on how much there is to sync. Take this time to pack your beach bag and don’t forget the sunscreen.

0
Team EaSE Article: SEO, Joomla! and your Template
Interview: Elin Waring, former Open Source Matter...
 

Comments

Already Registered? Login Here
No comments made yet. Be the first to submit a comment

By accepting you will be accessing a service provided by a third-party external to https://magazine.joomla.org/