Best way of version control of a live site

Discussion in 'Programming/Scripts' started by alleks, Nov 21, 2011.

  1. alleks

    alleks Member

    Sorry if I posted in the wrong place but where else? :)

    Can any1 help me with this question I made some time ago:

    By that I mean that when everything is ok and goes great I push to Production (Development -> Stable (Stable copy of production) -> Production) and what mainly I am looking for is for a way that automatically when new changes are submitted to Production it updates the LIVE Site through ftp or whatever type of transfer protocol.

  2. till

    till Super Moderator Staff Member ISPConfig Developer

    I used SVN for this purpose some time ago on several servers and it worked quite well.

    SVN takes care about that. If a file has been modified and commited by user 1 while user 2 works on it too and user 2 then tries to commit his work, svn will inform the user that he has to run a update on his repository first so that svn can merge the changes in his local copy before he can commit his work. This kind of version control (with svn or git) is used by most OpenSource projects weher a lot of poeple are working at the same time on the code.

    I wont use CVS as its quite old and not that easy to use, better use SVN or Git. If you develop on windows systems, then take a look at tortoisesvn client.
  3. alleks

    alleks Member

    Thank you Till, that's very useful to know... but what about the synchronization problem?
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    You create e.g. 3 branches in SVN:


    All developers have access to trunk. The release managers have access to testing and stable.

    Changes from trunk were merged (applied) to testing and if they work you can merge them to stable.

    You can then export the revisions from testing and stable to the webservers with svn export command.

    To get a easy way to switch back to a old revision later in case that somethin does not work in stable, then you can create a tag for every released version, so its easy to get back to that version.


  5. alleks

    alleks Member

    So subversion (the one and only I was avoiding) seems to have the solution :), but my question is how would that work if people have to push changes from a remote place (another pc) and I don't have a Fix/Stable/Own public IP but a dynamic one? I wouldn't like to make branches on a production server and work with them there, there should be only the Live/Production branch. I hope you understand my question.

    I do have another idea but I will have to test it first and then I will let you know, it involves a Shorcut/Copy/Remote folder called Production (like a shared folder over the network) of the live website and that will be a masterbranch and when merged changes to that folder they auto update because it's a "shared" folder copy of the webXX/web/.
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    You have one central svn server. This svn server can be any server that is reachable over the internet, it is normally not the productions system. All developers authenticate at this server with username and password of their svn account, svn has its own user and group management. So the IP addresses or connections of the developers dont matter.

    If you want to get a version of the code live, then a script on the live server connects to the svn repository server and pulls a copy of the code to its local harddisk.

    Thats not required. SVN can do this much better.

Share This Page