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

    I need some help to work efficiently. Here is my problem :

    My client and I work together on his futur MODx website. He adds content and tests the site on a production database whereas I resolve bugs and other issues on my development database.

    How sync our databases ?

    There are some softwares which can compare data and structure but the merge still has to be done manually.

    Liquibase (http://www.liquibase.org) can do that but requires to write a XML changelog file.

    MODx could handle that by a plugin triggered on xPDO execute event. But such an event doesn't exist.

    So, how to do that without hacking the core ?
    Is there a better way to sync database ?
    Have you ever had the same issue ?

    Thanks
      • 29597 ☆ A M B ☆
      • 350 Posts
      I actually just changed my workflow for this reason.

      To have my dev the same over multiple PC's I use dropbox+wamp for the MODx backend code.
      This way my dev code is always synced.

      For the DB I use a hosted SQL database on my hosting and allow (via Access Hosts) the IP adresses of the computers I need to use to connect to it.
      On the MODX install I then enter the IP of the host of my DB where I normally would enter localhost.

      With this I have the same code on multiple PC's and a single online DB!
        MODX Ambassador (NL) | Responsive web design specialist, developer & speaker
        DESIGNfromWITHIN, MPThemes and Any Screen Size
        Follow me on Twitter | Read my blog | My code on GitHub
        • 34078
        • 76 Posts
        It's a good solution when just one developer connects to database but when many persons (developers and/or clients) connect and update database data and/or structure that can quickly become a mess.

        I think it's more secure to work on separatly databases and merge them regularly (when many persons have to work on it of course).
          • 33976 ☆ A M B ☆
          • 571 Posts
          Hey Ben,

          AFAIK, there is no no-brainer solution.
          For a time i've looked at some solutions and found Shamblett's MODX FS which seems to allow to mount the DB in the file system, thus theoretically enables versionning for your DB data.

          Since i'm most of time the only dev working on a project, i dropped my quest to find the perfect multi-dev workflow, but i hope it might fulfill your requirements.

          Bon courage wink
            • 33968
            • 863 Posts

            Liquibase (http://www.liquibase.org ) can do that but requires to write a XML changelog file.

            MODx could handle that by a plugin triggered on xPDO execute event. But such an event doesn't exist.
            Couldn't you use the same plugin but trigger it on all the OnXxxxSave events? That way it would run whenever any of the Resources/Elements are updated within the manager:

            http://rtfm.modx.com/display/revolution20/System+Events
              • 34078
              • 76 Posts
              @romain : thanks i didn't know FUSE. It could be interesting but there are too much constraints like having a dedicated hosting. (Did you find the perfect multi-dev worflow ?)

              @Lucas : Yes it could be a solution. But it's a partial solution since there isn't an event for each action (access policies, system settings, ...) and none for plugins action.

              Maybe I should try with MySQL triggers, add a trigger for each modx table and store queries in a table ...