Best way to sync files and dev environment across computers?

I’m not much of a networking guy and have been using a single desktop for quite a while. I recently got a laptop and wireless router and I’m wondering what the best options would be for syncing files, especially my xampp dev server, between the two machines. I’d like to be able to work from both at times but keep the files synced.

Would I want to keep xampp and all my files on the desktop and connect to it from the laptop somehow? Or would I want to be running separate copies of xampp and just sync the htdocs (web root) and database folder? Should I say eff it and just work on my web server in a private directory? Or give up trying to keep both synced?

What do you do? And, how?

cable modem --> router --> Win7 desktop via LAN (w/ xampp installed already)
                       --> Win7 laptop via wifi

Thanks. :smiley:

It sounds to me that a version control system like svn would work for you.

^^^This man speaks the truth.

I definitely need to get in the habit of using svn or git whether it’s the solution to my current problem or not. But, since I’ve never used any kind of version control, I have a couple of concerns:

  1. I definitely see the value of using it for code on individual projects. But, keep in mind that I’d also like to have images (changed often during designing) and database files in my mysql folder synced. Would version control still be my solution?

  2. The other issue is that it seems like maybe it’s inefficient using the cloud when, most of the time, I’ll be on my home network. Or could I set some local repository in a shared folder?

  3. Lastly, do you have to check each individual file in when changes are made? Or can you check in a whole folder at a time and have only the files that have been modified updated in the repository?

Thanks :smiley:

I set up a local svn repository on a Fedora linux computer on my lan, it was pretty since svn is in the yum repositories.

Eclipse has a subversion plugin that makes it easy to deal with php projects from any workstation I use. You check out your project then work on local copies, then commit changes back to the svn repo, and with eclipse anyway you can commit all your changes in one step.

From a location outsite my LAN I connect using SSH when I need to visit my repo.

NOTE: I work by myself, not in a group. I’m sure there are many many things about using svn I don’t know :slight_smile:

Setting up SVN is not the right solution and probably won’t work very well. You will have to commit changes any time you want to switch machines and this isn’t the idea behind a commit. A commit should be a new feature or a bug fix, not just because you are switching machines.

The solution is to use Dropbox. You can use the LAN sync feature to keep things in sync which will make it quicker if you have large files. You can use this guide to setup symbolic links so you can keep your files other places on your disk if you wish.

I’ve long had this same problem, as I use a laptop and desktop regularly and I’ve found that Dropbox is the best solution.

I use dropbox as well, incredibly easy to set up and use. If you’re not familiar with it, worth reading through http://wiki.dropbox.com/TipsAndTricks to get an idea of other uses it can be put to other than syncing and backing up work directories.

Thanks. Dropbox was my first thought, but I’ve yet to use it either and didn’t know it had a “LAN sync”. I thought I would be wasting a lot of upload bandwidth constantly uploading to the cloud.

One question, those files will still count towards my allowed storage though right? From what I’m reading it sounds like it also uploads a copy to the cloud. I’m just wondering if I can stay under 2GB for the free plan. They are really working the freemium model here (quite a jump from 2GB to 50GB).

  1. I definitely see the value of using it for code on individual projects. But, keep in mind that I’d also like to have images (changed often during designing) and database files in my mysql folder synced. Would version control still be my solution?

Images shouldn’t hurt anything modern–we store GBs of images and video in SVN here. For MySql, you should really version the database schema change scripts, databases themselves are just build artifacts.

  1. The other issue is that it seems like maybe it’s inefficient using the cloud when, most of the time, I’ll be on my home network. Or could I set some local repository in a shared folder?

If you are just submitting changes, it shouldn’t hurt that much. Unless you have really bad home internet connectivity.

  1. Lastly, do you have to check each individual file in when changes are made? Or can you check in a whole folder at a time and have only the files that have been modified updated in the repository?

Typically, you check in the whole project which updates the repository with changes.

Yes everything in your Dropbox counts towards the storage. It will use the LAN sync to keep local computers in sync, but it still uploads to Dropbox as well.

2GB should be plenty, you don’t have to keep files in their forever. Just keep your current projects in there and then you can archive them later. You could also use Microsoft’s Live Mesh which works in a similar way assuming you only use Windows.

Yeah, DropBox is a nice simple solution.

If you have MAMP, WAMP and LAMP running on computers in your network you can point all of them to your DropBox folder with the project files and be golden.

Plus, you can get 250MB each time you sign up a friend (to a max of 8GB)!

Thanks for all the tips. :smiley: I think I’ll give both a try and see which works better for me.