We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 18582
    • 3 Posts
    Hello all,

    New to MODx, looking to use it for a project. This project will be carried out by me and one other developer. My question, and I apologize if this is somehow obvious, is how can I use a version control system such as Subversion on MODx when pretty much all the configuration seems to be done in the database? The best idea I can come up with is to just do a database dump and check that in, but this is slightly tedious and prone to error. Is there a simple way? Thanks for the help.
      • 7231
      • 4,205 Posts
      You can keep most of the resources in remote include files (templates, snippets, plugins, modules) and use SVN to manage to remote files.
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 18582
        • 3 Posts
        Quote from: dev_cw at Jul 06, 2009, 07:23 PM

        You can keep most of the resources in remote include files (templates, snippets, plugins, modules) and use SVN to manage to remote files.

        I see some of the resources in the "assets" folder, and some inside the database. What determines what resources go where?
          • 27708 MODX Staff
          • 2,502 Posts
          You can use a snippet to call templates and chunks etc from HTML/PHP files in the filesystem. By default this is not how MODx is set up but you are certainly welcome to do it. You can even go so far as to take DB snapshots.

          As far as content goes it makes more sense to do that post dev but that too could go into html files but if that is the case you may as well build in HTML.
            Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub
            • 18582
            • 3 Posts
            Thanks for the help. It would seem from these responses that most people are not using version control when developing MODx sites?
              • 22303 MODX Staff
              • 10,725 Posts
              Quote from: MasterOfNone at Jul 06, 2009, 08:23 PM

              Thanks for the help. It would seem from these responses that most people are not using version control when developing MODx sites?
              Many of us use Subversion to version the scripts we write as includes. But you are correct in regards to the database-managed content; there is currently no easy way to version this beyond creating SQL scripts to reproduce any changes you make to it (which I have been forced to do on occasion).

              Content Versioning is on the roadmap for the MODx 2.1 release cycle which will begin once MODx 2.0.0-final is released, however this will not necessarily address your need to use Subversion to version the DB content. The Transport Packaging system in 2.0.0-beta might fit your needs though, as you can use it to script the building of update packages that can be delivered directly to a deployment through the Package Management system. These build scripts, combined with Phing/Ant or some other build automation tool, could be used with Subversion effectively.
                • 5340
                • 1,624 Posts
                Question:
                How do you keep your DB under version control?

                Mostly Modx is in the database (except images and some snippets) but you could move your templates, snippets and even chunks in files.
                From my knowledge you can only keep sql scripts in a version environment not the data.

                For example a template can look like this in the DB
                [[includeFile? &path=`templates/site/template1.html`]]

                template1.html will contain all the html, chunks and snippets

                This way you can keep all the templates in a folder and manage it using version control.

                PS: These are just ideas. I’m not using a version control system for my websites. I personally would like to use one but it seems to complicated for small sites.