Using Local on multiple computers

Using Volumes Manager to map folders to DropBox also has a drawback: sites exported/archived to .zip do not include the mapped files. I currently map only the theme and plugin folders I work on to Dropbox, and when duplicating/archiving a site always have to remember re-mapping said folders into the new install. Logical, of course, but not quite perfect.
Oh, and the database is still un-synched, or rather, manually “synched” using Migrate DB Pro.

has this been figured out? would like to do this on google drive if possible.

Would like to bump this thread - if someone could figure this out it would literally be the ultimate WP dev environment…

2 Likes

Agreed. Would literally change everything about how I develop.

1 Like

Until this is something that is more easily doable with Local I’m running my local installs of WP from dropbox on my Mac that is then connected to a remote “development” database. Point the MAMP document root to dropbox on all your computers and you’re all sorted - you can pick up on a laptop where you left off all whilst developing locally…once Local does have this though please let me know!!

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

Bump. I assumed this would be a “no-brainer” feature when I first installed Local; that everything would be self-contained in whatever destination folder was chosen by the user. Like virtually every other application. Why the Local app’s per-site configuration isn’t stored with the site doesn’t make sense.

Thanks for these instructions. When creating the new site on second computer, do you leave the site path to default? On my original site, I have put that site path in the dropbox folder, so I’m wondering if that was a mistake that the volumes add-on instructions is trying to fix.

Thanks again for the help!

Site path doesn’t matter on the second site since you’ll be remapping it with the Volumes add-on. I would just keep it as the default.

I followed the steps just so that I could move everything over to Dropbox while developing. That said, whenever I restarted the site I now see Error establishing a database connection.

Whenever I click on connect to Adminer to check the database I see no such file or directory…

I still have the mysql backup so hopefully i’m not totally screwed

I’d check the MySQL log in the logs directory for clues.

Yes I have two designers that work on these sites - is it possible to share the root folders on same network? idk any thoughts on how this works?

Hey, i followed @clay instructions and it works, only thing here is that You need to turn on “Faster Docker Volumes” in app preferences - advanced.

1 Like

Is there an issue with using Flywheel as the bridge? I.e. Develop on computer A, push to Flywheel using Local on computer A, pull from Flywheel using Local on computer B?

Not ideal, have to pay for that site on the server, but would this not be a viable way of bouncing dev between two machines?

@rookpsu

Yup! Connect to Flywheel is a great solution for this in the meantime :smiley:

I used to run this setup with MAMP, not sure if it’s possible with LBF but it seems close.

So we have 3 computers - one acts as the server (computer 1), I develop on another one (computer 2) and our second developer was on a third computer (computer 3).

We had MAMP running on the 3 computers.

Computer 1 had the site setup on it… but all we needed was the database. We then copied the files to computers 2 and 3.

Then on computers 2 and 3 we changed the wp-config.php file to point at computer 1’s database by doing:

/** MySQL hostname */
define( 'DB_HOST', '192.168.1.75:3306' );

So the database was always in sync between us. We then used GIT to sync the files between us.

I’ve tried something similar with LBF by changing the configs on computers 2 and 3 to point at the database on computer 1:

/** MySQL hostname */
define( 'DB_HOST', '192.168.95.100:4002' );

(All those details are in the LBF dashboard)

It can’t connect to the database though. Is there a way to change the config to point to another computers database?

Hi, I can sync files across 2 machines using the volumes add-on, but I’m unsure on how exactly you used mapping to sync the database. I can’t find a ‘let me hold your hand through the steps’ tutorial any where, is the reason because you feel it’s a bad idea to sync databases, and you’d rather we didn’t? Thank you.

Ok, it’s working, databases are syncing thanks to you. I plan on making a YouTube tutorial, don’t worry, I’ll make it absolutely clear that this is not supported! I think flywheel has the potential to easily be the number one leader in this field, that is, the go to solution for devs to set up their local projects. Thanks guys, and please, find a way to start charging some money for this lol!

Any recent updates on this? To recap, I’d like to be able to store my sites currently under development entirely in Dropbox so that I can work on my iMac or MacBook Pro as necessary, always having the latest changes.

I’m primarily a designer, not a developer, so Clay’s command line instructions above are just north of my pay grade. Hoping for a slightly more automated solution.

Hey @Collin

With the new releases of Local ( the 5.x line of releases ) this sort of thing should be much easier to accomplish, however there will still be an issue of re-importing the database on the different machines.

If you haven’t done so yet, go ahead and download and install the most recent version of Local from the Releases category her in the Forums:

From there, you should be able to create a new site and store it somewhere like a Dropbox folder. Then, whenever the site is stopped, the database will be exported to sql files within the sql folder for the site.

This will mean that the files and database dump will be syncing, however, you’ll need to re-import the database from the sql files when you change environments.

This is probably the most tricky part if you aren’t using the command line, or some other tool to import the DB since there are so many possible ways of going about this.