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
- 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:
- Created a site I want to share with multiple computers via Dropbox
- Right-clicked on the site and then went to “Open Site SSH”
- Entered
cp -r /var/lib/mysql /mysql-backup
- With the Volumes add-on under “More”, I pointed
/app
to a folder in Dropbox named something like~/Dropbox/site-name/app
- Added a new mount pointing to
/var/lib/mysql
in the container and set~/Dropbox/site-name/mysql-raw
as the host folder - Right-clicked on the site and went to “Open Site SSH” again
- Entered
rm -rf /var/lib/mysql/*
- Entered
cp -r /mysql-backup/* /var/lib/mysql
- Restart the site
- 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:
- Wait for Dropbox to sync!
- Create a new site with the same exact domain as the one on the other
- Use the Volumes add-on to link
/app
and/var/lib/mysql
like before - You should be good to go after that. If not, restart the site.