The Joomla! ® Community Magazine

Sync Joomla! websites with MAMP and Dropbox on your Macs

Written by Cristina Solana | Sunday, 01 August 2010 15:10 | Published in 2010 August
Level of Difficulty:Intermediate 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.

Read 19590 times
Tagged under Developers
Cristina Solana

Cristina Solana

Frontend Dev of the Molajo tribe. Smallish. Shy. Terse. Resolutely irreverent. My manifesto: http://bit.ly/SandboxManifesto

Leave a comment

Make sure you enter the (*) required information where indicated.

[b] [i] [u] [s] [url] [quote] [code] [img]   

Comments (24)

  • avatar
    • 0
    • 0
    Suzanna

    Cristina, thanks for clear instructions that even a very new Joomla user can follow. I'm also a language specialist and proofreader, so it probably helps that your use of English is so lovely. (Not at all common, I'm afraid!)
    I'm familiar with everything except Symbolic Link, so that's my learning curve for this session.
    Keeping the tether as long as possible is a constant goal of mine. Thanks again for helping with that.
    Cheers!
    p.s. Patience with my old Wordpress websites. It's a process...

  • avatar
    • 0
    • 0
    Cristina Solana

    Suzanna, I am glad you found this helpful. I am sure you will find that the SymbolicLinker is going to be the easiest part of the process. Feel free to give me a shout if you run into any trouble and I will try my hardest to help. Happy syncing!

  • avatar
    • 0
    • 0
    Rick Blalock

    What a great idea! Love it.

  • avatar
    • 0
    • 0
    Cristina Solana

    Thank you Rick... this works great if you are a workaholic (and like the beach).

  • avatar
    • 0
    • 0
    Robert

    Long time on my list to find a way to do something like as this. Thank you very much for this useful article.

  • avatar
    • 0
    • 0
    Gary Edge

    I'm getting a 403 error "You don't have permission to access / on this server". I've been changing permissions all over the place and haven't had any luck getting it to work.

    Any suggestions?

  • avatar
    • 0
    • 1
    Cristina Solana

    @Adrian: syncing to a server serves a different purpose than syncing across your own machines - of course, it could be done with SVN or Git, but that is a much more advanced topic.

    @Thomas J, Thomas D and Dave: Glad it was helpful. Thanks for dropping a comment.

    @Gary: when are you getting that error - what exactly are you doing when it shows up?

  • avatar
    • 0
    • 1
    Gary Edge

    After I set things up following your instructions (thank you btw), I created the folders for several joomla sites in the _sites directory and downloaded code directly from the live sites using Transmit. The DBs already exist locally. I've reset the directories in MAMP but when I type http://:8888 into a browser I get a page with that error. I'm wondering if it's an .htaccess issue.

  • avatar
    • 0
    • 0
    Cristina Solana

    Gary, try: http://localhost:8888/MAMP/?language=English - if that comes up you are up and running. (Make sure you start the server)

    If you just do :8888 or http://localhost:8888 you will get a permissions error.

    Once you have a website in your sites folder you have to do http://localhost:8888/my-site-directory

  • avatar
    • 0
    • 0
    Adrian

    Nice idea,

    temporarely for a small team or circumstances.

    But I have only one macbook with a XAMPP-Installation.

    A sync with a real server seams to be more productive.

  • avatar
    • 0
    • 0
    Dave

    Thanks Cristina. I've been searching high and low and wondering whether there's such a possibility. You save lots of Joomla's fans.

  • avatar
    • 0
    • 0
    Thomas J

    nice trick. if you have more than one mac u working on. Very useful for my office / laptop use.

    ps: your website is created.. take a look.

  • avatar
    • 0
    • 0
    Thomas J

    @ Adrian;

    sync with a real server is more interesting, but then I would like an option to turn OFF the sync when I want to.

    How is Joomla (and v1.6) handling the editing of content, and the possibility to WORK online, but submitt the work when its done. Not Live editing as it is today.

  • avatar
    • 0
    • 0
    Thomas Dobner

    very useful article! I tried it and it works perfect!

  • avatar
    • 0
    • 0
    Shakir

    That's a wonderful idea and I feel lucky to find it out. However as Adrian said, it would be awesome to sync with a real server environment. It would be lovely to work offline on the real website and sync it when back from the beach.
    Can you please please explore it out and make an article on that as well.

  • avatar
    • 0
    • 0
    borb

    Happy new year. Its a great post! just curious of why couldnt you use an alias of directory instead of symbolicling?

  • avatar
    • 0
    • 0
    Dr. Tv

    Great article. Too bad you cannot just do this for me. :)
    But it sounds easy. I will give it a try.

  • avatar
    • 0
    • 0
    Selmar Pigge

    Hello!

    I have a problem on getting the:

    And finally, let's sync those other machines…
    "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”.

    It doesn't show the “Make Symbolic Link” again. Even when I clicked on the "run SymbolicLinker.service once by double-clicking on it."

    Can you help me out Christina or someone else?

    Thanks allready!

    Selmar

  • avatar
    • 0
    • 0
    Cristina Solana

    Thanks for all the kind comments, I may work on something for live servers soon using Git. :)

    @Selmar, it's been quite a while, but I can try to help. I don't remember having to make SymbolicLinker, it ran after install and appeared in my context menu.

    What operation system are you using - Tiger, Leopard, Snow?

  • avatar
    • 0
    • 0
    Selmar

    I allready fixed the problem! :)

    Thanks!

  • avatar
    • 0
    • 0
    GoffRose27

    When you are in uncomfortable position and have no cash to get out from that, you would require to receive the personal loans. Just because it would help you definitely. I take commercial loan every single year and feel fine just because of it.

  • avatar
    • 0
    • 0
    Russ

    Cool but will it play in Mazatlan?

  • avatar
    • 0
    • 0
    Russ

    Oh. Question. I have 1.5 running in MAMP ok but want to kick up to 2.5. What's involved? All online instructions seem to refer to 1.5.

Language Switcher

Grab the Joomla! Community Banners! Spread the word!

Recommend us on Google+