Using Local on multiple computers

I recently tested this with Local on macOS (Faster Docker Volumes enabled) and it works. You have to use the Volumes add-on mentioned before.


Before going into what I did, here are some important notes:

  • This is not supported! Do not complain if and when things break :slight_smile:
  • Do not run the site on both computers at the same time. You will run into nasty conflict files and then have to use InnoDB’s recovery functionality.
  • To reiterate, stop the site on one computer before running the site on another computer
  • Wait for Dropbox to sync prior to starting the sites!

Here’s what I did:

  1. Created a site I want to share with multiple computers via Dropbox
  2. Right-clicked on the site and then went to “Open Site SSH”
  3. Entered cp -r /var/lib/mysql /mysql-backup
  4. With the Volumes add-on under “More”, I pointed /app to a folder in Dropbox named something like ~/Dropbox/site-name/app
  5. Added a new mount pointing to /var/lib/mysql in the container and set ~/Dropbox/site-name/mysql-raw as the host folder
  6. Right-clicked on the site and went to “Open Site SSH” again
  7. Entered rm -rf /var/lib/mysql/*
  8. Entered cp -r /mysql-backup/* /var/lib/mysql
  9. Restart the site
  10. Once you verify it’s working right you can SSH in again and rm -rf /mysql-backup to remove that folder

That will set the site up to start syncing with Dropbox.

Now, on the other computer you’ll need to:

  1. Wait for Dropbox to sync!
  2. Create a new site with the same exact domain as the one on the other
  3. Use the Volumes add-on to link /app and /var/lib/mysql like before
  4. You should be good to go after that. If not, restart the site.
3 Likes