We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5689
    • 289 Posts
    I run a local Linux server in my room at home for testing purposes, and I prefer to develop with MODx and other PHP-related things because it’s much quicker than working off my Hostmonster server. What I do with most things is keep the files in sync between the local and live versions, and then I just export my MySQL database from the local server and import it to the live one.

    With MODx (or any CMS, really), this becomes much more difficult. Is it possible to feasibly do this?

    I spent a few hours yesterday trying to recover a broken MODx installation (turns out it wasn’t exactly broken, but that’s irrelevant) and trying to get my local copy to match the live copy. I managed to get a fresh copy on the live server updated with my previous database and what not so it was all back to normal. Getting my local one back to normal isn’t working out so well. I installed a fresh copy from SVN as well and installed the exact same packages as the live one has. I set up the configuration files and let MODx install with it’s normal setup process. Then I exported my live database and imported it on the local server, overwriting the entire thing. Unfortunately, the login is not completely messed up in both appearance nad functionality, as in I can’t log in because I just get errors.

    I’m thinking I need to only export/import certain tables from the database and just sync the rest by hand in the manager. Things like components won’t change often, so as long as I keep them the same in both installations, I should be able to just get the tables for my content, meaning resources and content elements. I’d leave tables along that contain any session data, and I would probably need to leave the system settings table alone.

    Theoretically, it shouldn’t be impossible to sync two copies. Has anybody had more experience/success with this? I don’t mind if it takes a bit of work to figure out, but I’d like to get to where I know how to do it and can sync them pretty quickly when I need to.

    It would be really, really nice if MODx had a built in export function that gave you exactly what you need to get another installation to match, but I realize that would be difficult to make.

    Thanks for any help.
      I'm learning more about MODx all the time and loving it.
      • 28215
      • 4,149 Posts
      You can export via SQL for Resources, Elements, etc. When you do an import, make sure the cache directory is cleared. Make sure you aren’t exporting any of the access tables, as those may not match on your new server.

      3rd Party Components can just be installed via Package Management on the new server.

      It’s hard to help you with the login bug without some other information.

      To be honest, sync’ing isn’t really worked out in Revolution yet. I know Shamblett had been working on a Component to do this; you might ask him.

      I had been working on a new version of the Package Builder; which would allow you to use a checkbox-tree to select exactly what Resources/Elements/Actions/etc you want to package up into a Transport Package, and then export to zip, by which you could upload to the new server, install, and viola - synced content. (It would also make building transport packages for Components much easier.) But it looks like this is going to have to be tabled until 2.0.1 or later because of a simple lack of manpower/time/etc. Gotta pay the bills. smiley

        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
        • 5689
        • 289 Posts
        Shaun, thanks for the very quick reply. I’m feeling a little more encouraged about this now. smiley

        Regarding the login error, I’m not going to worry about it. This has happened before when I tried to do a similar thing, and it was probably just because I copied over too many tables and things and basically just messed things up. I’m going to start over again using your advice, and I doubt it will happen.

        I’m looking forward to the things you and others have been working on that would make this easier. Until those arrive, I’ll just have to figure out a process to make it work every time.

        I have one question. You said to make sure the cache directory is cleared. Does that I mean I should delete every file/folder from core/cache? When I was messing around with it yesterday, I moved config.cache.php out of the cache folder to see if it would rebuild it, and it wouldn’t. MODx completely failed to load until I put it back. So I’m a little hesitant to clear the entire cache.

        Thanks!
          I'm learning more about MODx all the time and loving it.
          • 28215
          • 4,149 Posts
          Quote from: Compeek at Jul 31, 2009, 09:56 AM

          I have one question. You said to make sure the cache directory is cleared. Does that I mean I should delete every file/folder from core/cache? When I was messing around with it yesterday, I moved config.cache.php out of the cache folder to see if it would rebuild it, and it wouldn’t. MODx completely failed to load until I put it back. So I’m a little hesitant to clear the entire cache.

          Hm, that shouldn’t happen. I usually use the Clear Cache method from the top menu. However, in install circumstances, it might be necessary to completely clear the cache/ directory. That shouldn’t cause any major errors...not sure how that’s happening on your install.

          You *should* be okay without clearing the whole cache/ dir, but if things aren’t working, try that.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com