We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24719
    • 194 Posts
    i’ve just updated the README with a few notes about using the downloadDB command
      • 25663 MODX Staff
      • 12,272 Posts
      How does this handle updated content (not just newly created content)?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 24719
        • 194 Posts
        Ryan: This system allows the site_content table to be dumped to an sql file and put under version control.

        I’m working on a script that will build the site to production by copying over the files that have been created or modified since the last build (by checking the output of ’svn diff’). It will then import the site_content table to a temporary db locally. Then, for each document that has been modified since the last production build, it will query the production db to find out if the doc on production has been updated later. If the latest version of the document is already on the production system, the next doc will be compared. However, if the latest version of the document is in the temporary table, the script will run an UPDATE query to update the production table.

        I think this approach should allow for the latest copies of each document to persist on the production machine. I’m just having a few issues with the temporary db at the moment...
          • 4971
          • 964 Posts
          Being a rookie, all this sounds interesting to set up a good development (stage, production) environment...
          dont know if you guys had the chance to check XINC http://code.google.com/p/xinc/ which also
          sound very interesting and more importantly, to beginners like me, very user friendly!! to set up and use ...
            Website: www.mercologia.com
            MODX Revo Tutorials:  www.modxperience.com

            MODX Professional Partner
            • 24719
            • 194 Posts
            hi,

            i haven’t had a chance to play with xinc or cruise control, but using one of these tools is definitely what i’m working towards.

            i’ve created a script that will create a skeleton directory structure for a new project and that will create the tools needed to build and commit a project using svn.

            once i’ve made a script that will synchronise the site_content table i’ll release a package with documentation before working on implementing a continuous integration system.
              • 24719
              • 194 Posts
              just updated the package for this if anyone is interested.

              i’m also putting together a more complete package for using modx under svn that will enable management of the database.

              see the attachment further up. it’s just a bit more stable, and now has a linux init script for auto-starting it on the staging machine.
                • 5070
                • 36 Posts
                Hi, I’m trying your solution with modxDBServer package. I have finished step working with product server and had a project1-sitecontent.sql.gz
                Now I need to run service on my staging and develop machine, I have read the README several times but can not figure it out. what is the "PID_FILE=/var/run/modxDBServer.pid", and where i can find it?
                I’m new to Linux, i don’t know where to put files contained in the modxDBServer folder. can you show me more detail? lipsrsealed
                  • 4971
                  • 964 Posts
                  Redman: I will check it out for my next project...

                  does it work in virtual servers?
                  I am investigating using vmware or virtualbox to set up my work servers...

                  1) dev server
                  2) testing/staging server
                  3) production clone
                  4) production server

                  and don’t want four computers!

                  where do I install SVN? in another server?

                  for what I read your module just works with two servers?
                  is it hard to extend it to more?

                  thanks in advance...
                    Website: www.mercologia.com
                    MODX Revo Tutorials:  www.modxperience.com

                    MODX Professional Partner
                    • 5070
                    • 36 Posts
                    By the way, can you show me how to connect modx site with the modxDBServer, and the way to create and give name to new Document, Snippet, Chunk.
                    thanks alot!
                      • 24719
                      • 194 Posts
                      @chienquang: you could put the modxDBServer into /usr/local/bin on your testing/staging server, then edit /etc/rc.local (if you have one), adding:
                      /usr/local/bin/modxDBServer/startModxDBServer.sh


                      The only thing you should need to do to start the server is to run the modxDBServer/startModxDBServer.sh script. PID files are just used to keep track of the process id. It allows the script to terminate a running process if it is invoked several times (basically just for housekeeping). You don’t need to create them manually. Just make sure that the directory they go into is writeable by root (which it should be). /var/run is the standard location for pid files on Fedora/Centos/Red Hat systems.

                      Once you’ve configured modxDBServer (by editing server.properties.inc.php), and any firewalls that are in the way, you should be able to use modxDBClient on another machine. You’ll need to edit client.properties.inc.php, and the server name and port in modxDBClient (these should really be settings in the config file too). Again, you may need to edit firewalls to allow connections on port 2001 (unless you change the default port) on the staging box.

                      Then, you should be able to create new docs/chunks/snippets on with a call like:
                      modxDBClient createDocument local-db-name 10

                      where 10 is the id of the parent document to use, and local-db-name corresponds to an entry in the client.properties.inc.php file.

                      This will create a stub document in the production db and dev db. You can then edit the stub on development, and update the content on production by using a REPLACE INTO ... statement.

                      i’ve developed several more tools for version controlling and deploying database schema changes, and also for automatically deploying and version controlling documents/chunks/snippets, etc. Hopefully i’ll get some time at some point and be able to release a full suite of tools in the next couple of months.

                      also, don’t forget to install the dumpDBs script onto your production server, and set it up so it runs every day (or night) if you want to be able to download a stripped down copy of the production db. My other tools will explain why you’d want to do this if it’s unclear...

                      @charliez:
                      * i haven’t used this on virtual servers, and don’t have much experience with them. For the system to work, it relies on the client being able to connect to an instance of modxDBServer.
                      * i’ve put svn on the test/staging server because it made no sense to use another machine for me.
                      * as for extending it to work with more than 2 servers, if you wanted your production clone to be a true clone, could you use replication? then i suppose that if modxDBServer connected to the master, its changes should filter down to the clone too. Alternatively, as long as you can establish a db connection to the databases you want to modify, you should be able to alter the code to make it update several databases as you want.