We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 9207 ☆ A M B ☆
    • 2,475 Posts
    How are people handling tiered or staged deployments with MODx? (E.g. Dev to Staging to Productions environments)? I’ve asked about things related to this previously with regards to making this simpler in MODx:

    http://modxcms.com/forums/index.php?topic=59136.0
    http://modxcms.com/forums/index.php?topic=59056.0
    http://modxcms.com/forums/index.php?topic=43187.0

    But I was wondering if people in the MODx community were as curious about this as I was...

    Thanks for sharing any input!
      • 34077 ☆ A M B ☆
      • 64 Posts
      Which version, evolution or revolution? Personally I haven’t found a great solution yet so would love to see what others have. Only things I’ve found tend to be a bit manual for the CMS parts.
        Jason Bird
        Twitter: @jasonabird @threeeyedbird
        • 9207 ☆ A M B ☆
        • 2,475 Posts
        I was thinking more Revo... but heck, why not Evo too? I’ve already found some workarounds with Evo, though.
          • 19302
          • 6 Posts
          This is an excellent question - one we were talking about just the other day.

          The only solution we could come up with, is mysqldump and file copy from staging to live and reversed - thinking of a bash script to do it, but it’s too clunky in practice, especially when you’re managing a lot of websites.

          Contexts in theory should be ideal, but you can’t have an instance of the same resource (ie, leave one in live, make changes on the dev to the instanced resource - sure you can duplicate the resource and make changes - but that’s redundant), and templates, chunks, etc aren’t context based, that kind of rules that one out.

          Using the provisioner is basically no different to mysqldump and file copy - and slower.

          Veerry interested in any solutions others have - it needs to work with files / chunks / templates / resources.
            • 9207 ☆ A M B ☆
            • 2,475 Posts
            Yeah, I do it with mysqldump and a couple bash commands....

            But mysqldump is by definition not database agnostic. I think they’re gonna have to come up with a JSON or some-such format that exports the db in an agnostic way.... but then you gotta wait around for PHP to do it... and memory errors abound. Duplicity and other backup scripts (or copying scripts) will use "chunks" that define a max file size (e.g. 250mb), and I suspect any custom dump utility will have to have that ability.

            I prefer having a single configuration file that contains the details that differ between the server. I confess I’m not a fan of having to update the workspaces table and the various file asset paths in the database... that should be unquestionably in a file in my mind. Some system settings are slurped up from the configuration file, why not have ALL of them slurped up from the file? Revo is way harder to port than any other web app I’ve dealt with... so I’m looking for some improvements here.
              • 19302
              • 6 Posts
              Perhaps the best way is a modified provisioner (setting up two seperate rev installs & db) - I mean the basics are there already - it’s just not built with this in mind. This way you could be db agnostic, etc.

              But then, it would need to be well integrated into the manager for it to be of any use. The ability to make live (by push/pull) any template / chunk / resource... a sync all.. It would be a big job :/
                • 18654
                • 191 Posts
                In core/config.php I have the following code:
                <?php require_once($_SERVER['DOCUMENT_ROOT'] . '/../../webconfig/config');
                and keep all my config data in the included file. Since the path to my config file is relative it works on local and production environment. However, this still doesn’t take care of the database configuration differences (i.e. workspace - btw, does anyone know why workspace is stored in the DB anyway??). I’m hoping to come up with a way to override database settings via the single config file.

                As for the matter of chunks and snippets, I believe file based chunks / snippets are on the ModX roadmap. In the meantime, I’m planning on experimenting a bit more with includes so I can utilize a file system for my code.
                  God does not save those who are only imaginary sinners. Be a sinner, and let your sins be strong, but let your trust in Christ be stronger, and rejoice in Christ who is the victor over sin, death, and the world.
                  • 577
                  • 132 Posts
                  I have been brainstorming this one myself and will need a solution soon (convoluted or not). In my minds eye some kind of mash up logically between something like VersionX and Babel would be going down the right path. There is also the concept of a draft copy from the clients perspective while in their live env that would be great in addition to the dev/staging/prod workflow process.
                    "One of these days I will get around to my own website... Its only been about 12 years... maybe tomorrow smiley"
                    • 22873
                    • 9 Posts
                    Adminer (http://www.adminer.org/en) might be an interesting helper tool. It has an "ALTER" export, which is intended especially for projecting changes from dev to production database. But I have not tried it for that purpose yet (I’ve only used it as a phpMyAdmin replacement).

                    Nevertheless, it is not fully database agnostic. I am affraid, that a DB agnostic tool would be very complex, as it might deal with indices, trigers, etc., which are rather database specific.

                      • 10189
                      • 109 Posts
                      I’m surprised no one has mentioned transport packages yet (as far as Revo goes). Isn’t that made for this kind of work?