I setup my Dropbox to sync between my computers so I can ensure I’m always able to pick up where I left off when developing locally, even when work is not yet committed. More importantly, I can very easily roll back changes/deleted files since I use Dropbox’ packrat feature.
Here’s how to get it setup:
Start with Local setup with the sites on one computer, store the sites you want to share inside a Dropbox folder
Export each site to blueprints
Move blueprints from ~/Library/Application Support/Local by Flywheel/blueprints to the other computer
Install Local on other computer
Import blueprints but use a different folder outside of the Dropbox folder, this is temporary
Enable the add-on ‘Volumes Manager’ then restart Local
Go into each site that you want to be based in the Dropbox folder and start them
Go to the More > Volumes section of the site info
Adjust the directory path easily by changing the values on the left side, then click ‘Remap Volumes’
Local will provision the updated mappings
After doing this for all of the sites you want to move/change, edit the ~/Library/Application Support/Local by Flywheel/sites.json file and adjust the ‘path’ strings there too.
Now you’ve got Dropbox shared Local sites, which shares the files and server configs/logs.
FYI, same method works for any file syncing method, if you’re using Google Drive or whatever. Goal is to ultimately get Local to change the path to the synced directories.
Sorry, unable to help you since I didn’t run into that. I would suggest opening a new topic, linking to this one saying you followed the steps, and posting your exact error.
This is actually a giant step back from using MAMP/XAMP, especially for anyone who has more than a few sites to sync, more than two machines to sync with, who is frequently creating new sites or rarely switches between machines.
Compare with:
Install MAMP on Mac A and point web root to dropbox
Install MAMP on Mac B and point web root to the same folder
… and point the each WP installation to a remote DB, but I suppose that is also needed in the Local setup you describe but isn’t listed as a step. The crucial part is that it syncs all existing and future installs in one go with far fewer steps.
It’s like all the smarts that have gone into Local’s various features are working against it when you want to sync sites. I am going to write a feature request for Local to recognize existing container directory structure. I hope that’s even possible with all the virtualization tech.
I’ve tried sharing DBs too back when I used VVV and that wasn’t pretty.
I would like to see Local have the ability to pick up new installs from the “Local Sites” folder (if the folder structure matches theirs and files are there).
But beyond that, the instructions I posted above aren’t really too hard to follow. You do it once and then you’re done on each machine. It’s been working great for me, I’ve had it up and working on three Macs (iMac + iMac + MBP) at once too.
The problem with dropbox it’s the app dont work correctly if you have over 300 000 files ! and wordpress use a lot of files. Me i have project folder, which contain a lot of website test and have over 900 000 files, and now dropbox dont work very good…
@sc0ttkclark Thank you, I think i might get this to work.
I am however stuck on point 14.
1.) Do I move the sites.json file from the original computer or the 2nd computer?
2.) Where to do i move it?
3.) If I have some sites on the second computer that I do not want to sync with `dropbox, will they stay in tact?
This part was rather obvious, my bad:
Just edited the sites.json, and changed
“path”: “/Users/user/Local Sites/beads”,
to
“path”: “/Users/user/Dropbox/Flywheel/beads”,
BUT, when testing it doesn’t work.
Stopped both sites on both computers.
Quit LBF on both computers
Open LBF on 1st computer and start site
Add new post.
Stop site
Quit LBF
Wait for dropbox to finish sync
Opened LBF on 2nd computer
No changes, no new post…
If I add a plugin on the one computer, it reflects on the other.
But If I activate it, it stay deactivated on the other computer.
So the issue seems to be the path to the SQL that is wrong…
Sorry to revive a zombie thread, but has anyone figured out how to do this with Local Lightning? I’d like to be able to work with the same files across machines but with the newer/faster setup!
Yes, but the specific steps you have to take and/or paths you have to symlink are different. This thread started out with step-by-step instructions, so that’s what I’m looking for, in case there are major differences between the old Local By Flywheel and the new Local Lightning under the hood.
And it looks to me like there are big differences. I imported some sites to an iCloud Drive directory on my iMac right before getting a MacBook Pro. Then I used Migration Assistant to set up the laptop. It seemed like both installs of Local were working fine, using the same paths rooted in iCloud Drive, as long as they weren’t running concurrently.
But then I realized the databases were getting out of sync. It seems like Local Lightning doesn’t actually store the raw db data inside the Site path, but rather in ~/Library/Application Support/Local/run/[site-specific ID]. So you may need to copy something in this part of the filesystem onto your cloud storage and them symlink it back to your ~/Library on each computer in order to keep stuff in sync.
I would be interested to know if anyone has worked out the details!
I, too, would be interested in a step-by-step guide to syncing databases between installations of Local 5.1.X, even if it’s not officially supported.
I’ve posted elsewhere how to store Local sites on a shared drive and use the same set of files on each installation. But my method for database syncing is kind of clunky. It involves backing up the database on one installation using a plugin like Updraft Plus and then restoring it to the other.
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:
Create a new website with Local on each computer, ensuring they have identical names and settings.
On your shared server / cloud folder, create a folder with the same website name (this will house the shared files).
Move one website’s app folder to your shared/cloud directory.
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).
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).
Go to that folder in the Finder and similarly to before, drag the mysql folder to the cloud/shared directory
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.
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.
Repeat steps #4 and #7 to create symlinks on your second machine pointing to the shared/cloud app and mysql folders.
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!
Thank you @hellojd! I haven’t tried this yet but I hope to soon. Coronavirus has temporarily rendered the point moot for me.
For others who are interested in syncing Local sites, I can report that iCloud is probably not the best place to keep them.
The attraction of iCloud (on MacOS) is that I can keep my Local sites in my Documents folder and they’re automatically synced between computers.
The problem is that iCloud suffers some lag when between when files are deleted from your computer and when they’re deleted from the server. In normal file operations, this is not an issue. But when I update a plugin, I often wind up with two copies of all the files in the plugin folder – I see things like “plugin.php” and “plugin-2.php.” The plugin developer didn’t put the second file in there, iCloud did.
Here’s what happens: If the original pre-update files don’t get deleted from iCloud before they’re replaced with the new ones, iCloud tries to sync back the originals from the cloud to your computer. And so you get two copies of the same file.
A workaround for this is to manually update the plugins by deleting the old version of the plugin, checking to see that its folder gone from the iCloud server, and then adding back the new version. But a better solution is probably to use a different cloud service.