Using Dropbox to sync Local sites between computers under Local Classic

I was able to make this work with Local Lightening. I find it to be a bit more complex than the previous method (I wish there would be a way to sync sites directly through Local), but for someone who works from a desktop and laptop quite regularly, having my projects in sync is essential.

I’ll probably create a more thorough step-by-step article soon, but here’s how I achieved it:

  1. Create a new website with Local on each computer, ensuring they have identical names and settings.
  2. On your shared server / cloud folder, create a folder with the same website name (this will house the shared files).
  3. Move one website’s app folder to your shared/cloud directory.
  4. In Terminal, type ln -s then drag the app folder from the shared/cloud directory into terminal (this is a quick way to get the path) then drag your local website folder in right after. The command should look something like this: ln -s path/to/shared/app path/to/local/website then press enter (you should see a symlink app folder appear in your local website directory).
  5. Next, locate the database folder by going to the “Database” tab in Local and following the socket path. The folder you want to go to will be a random combination of letters and numbers (right before the mysql folder). This should look something like /Users/Username/Library/Application Support/Local/run/G0xUGB4jj (every site will have a unique letter/number combination).
  6. Go to that folder in the Finder and similarly to before, drag the mysql folder to the cloud/shared directory
  7. Create a symlink from the shared mysql folder to the local directory, which would look something like this: ln -s path/to/shared/mysql Users/Username/Library/Application\ Support/Local/run/G0xUGB4jj (or whatever your folder is called). Press enter and you should see a mysql symlink folder appear.
  8. On your second machine, delete the website’s app folder and locate the database in the same manner and delete its mysql folder as well.
  9. Repeat steps #4 and #7 to create symlinks on your second machine pointing to the shared/cloud app and mysql folders.
  10. Now, both sites should be sharing the same website folder and database. If you make changes on one, they will be reflected on the other (but make sure you never run the sites at the same time or this will cause database conflicts).

Hopefully this helps anyone else that is looking to do the same thing!

3 Likes