WordPress.org

Ready to get started?Download WordPress

Forums

Developing Locally across several machines? (5 posts)

  1. TomHayes
    Member
    Posted 8 months ago #

    Hi guys,

    first post on here, as a relatively new WordPress user: about a year.

    I've been stumped as to how to approach the issue of developing across several computers, after reading several times that working on sites live is poor practice and I should avoid doing so.

    My issue is that I work on websites on 3 different computers: my work computer (iMac, my home computer (Windows 8) and also my Laptop (Windows 8). I am struggling to determine a way of working that allows me to develop locally across these 3 machines. So far, I have worked out these 3 possible methods:

    1. DropBox: I could potentially sync the htdocs folder across the three computers using DropBox. This poses an issue though because one of my computers is OSX, which uses MAMP, and my other 2 both utilise WAMP. I would also have to sync the database folders - this is quickly going to eat up space in my DropBox!
    2. WAMP Poratble: I could install WAMP portable on a USB drive, and plug that in to access my sites. Obviously this poses the same problem: not being compatible with OSX, and having to have the USB stick on me at all times I wanted to work on a site could pose problematic - not to mention if I lost it!
    3. Git: lastly, I could use a Git repository to sync the site across the 3 machines (I think!). However, after reading up on Git, I still feel none the wiser, and can't help but feel this is intended for real software development and not for building a few WordPress sites - there must be a more eloquent solution!

    So am I missing something here? If so, what? If not, which option should I go for?

    Thanks for taking the time to read this, this forum looks like a really useful resource - I only wish I'd noticed it sooner!

  2. 2ninerniner2
    Member
    Posted 8 months ago #

    I also work on a mix of Mac and Windows computers, both at home and at work. I just use either a sub domain or a sub directory on one of my hosting accounts. An added benefit is that you are seeing how it will look and respond live. This is the method I use for creating a site that will eventually be going live, especially on mobile devices. I generally reserve the local installs for testing and "mucking about".

  3. TomHayes
    Member
    Posted 8 months ago #

    Hi, thanks for the reply!

    This is how I have been working at the minute - however, I've read in a few places that working "live" isn't a good idea - not just because you can break sites, but because it's slower, you can't use things like preprocessors that easily (and I'm trying to learn SASS), and you can use useful text editor tools like Find In Project.

    Thanks for your suggestion, but I can't help but feel there must be a better, more professional way to address this problem... then again, maybe I'm wrong. Any ideas?

  4. AncaIO
    Member
    Posted 8 months ago #

    Hi,

    If you want to sync everything (including the database) you need to be aware that it will most likely be a "one-way trip". So, basically, you need to figure out which computer will be the "master" and which the "slaves".
    This is because the database on the "master" will be the one pushing the stuff out to Dropbox and from there to your other PCs.
    Try this tutorial, maybe it will put you on the right track.

    If you don't need to sync your database, you can use either Dropbox or Github / Bitbucket with a good client. Bitbucket offers free private repos, I think. For your OS X machines, you can get Tower. I am sure there must be a similar tool for Windows machines and you can find a good one with a little bit of research.

    Dropbox is obviously the cheapest and easiest way to go, but it won't keep track of your changes. If you go with git, you gain "version control". You will be able to track the changes you made to your code. If you are not lazy at typing commit descriptions, you will find this feature extremely useful when reviewing your code. Plus, if you use a client like Tower, you won't need to be bothered with terminal commands until you feel more comfortable with git.

    Another option would be to have a live test environment, develop locally and deploy with Beanstalk. At the end of every day, deploy your code, whether good or bad. Move to the next machine, sync what you have on the live test environment with a tool like Transmit (on Mac) and continue your work. Again, when hitting the pillow deploy with Beanstalk. Of course, you would need to find a tool similar to Transmit for Windows.

    I personally have a live dev environment and use Transmit on a daily basis, but I am at the level where I don't produce site or server breaking code that often. I reserve the Dropbox/Mamp sync for times when I'd rather not be bothered with a live installation, but, eventually, you will have to test your code on a live server, so you might as well have better means to sync your local and live stuff than plain FTP clients.

  5. Dragons Eye
    Member
    Posted 8 months ago #

    Not too sure if this falls in line with the topic,

    But, I have my website installs on SD-cards, so that I can switch them out as each one has a different website on it. I did this through LAMPP ("XAMPP-for-Linux") by altering the "DocumentRoot" directive in the httpd.conf file to point to the location of the SD-card (in my case: /media/<user>/HTDOCS). The only draw-back: The SD-card (or whatever removable media you are using) needs to be labeled "HTDOCS" (or whatever name you used for it in the httpd.conf file).

    However, it works well for me, and I can change out the card for a different one for working on a different website project.

    On LAMPP if you change out the card or removable media, you MUST stop and restart Apache, as each drive or removable has a different UUID code associated with it! (Regardless if they are labeled the same name or not.)

Reply

You must log in to post.

About this Topic