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

    Hope somebody can help - I'll try and keep this as clear as possible but I'm pretty new to modX and a designer by trade!

    I took over running a modx site for a business that an existing client bought and updating was going fine for the last few months (new products, news ect...)

    In the background the site has moved servers and is now up and running on the new server.

    Problem I have is that the backup that the old IT guys gave to the new people was four months old. So when the server switched over I've lost 4 months of work and updates.

    Thought this wouldn't be a problem as I'd downloaded the site from my FTP access. I then added to the new server via FTP and changed all the nessesary config files - was very happy as worked perfectly and the site is back to where it should be...

    But! - Had a few issues with the manager so thought would clear the cache - as soon as I did this the site reverted back to the old version...

    Tried a few times but the same thing happens - I'm assuming this is something to do with the database? Is there anything that can be done?

    Thank you...
      • 3749
      • 24,544 Posts
      It's an excellent mystery!

      I'm not doubting your story, but I'm having trouble coming up with a scenario that explains your symptoms. Clearing the cache should give you a newer version, not an older one. In other words, say the site is working with the new stuff. If there are no cache files, clearing the cache will have no effect. If there *are* cache files, the the new stuff must already be in the cache (since you're seeing it). If MODX was set to deliver the old stuff (visible once you clear the cache), how did the new stuff get in the cache in the first place?

      And if you got the new stuff to show, MODX must know where the correct DB is (because that's where the content is and you saw it). I don't see how clearing the cache could confuse MODX about which DB to connect to.

      All that aside, let me explain the MODX configuration system. It could help you figure out what happened.

      There's a file in the MODX root called config.core.php. There are copies of it in the connectors and manager directories. All three should be the same and should contain the path to the MODX core directory.

      MODX looks in the root config.core.php file to see where the core directory, then it reads the master config file (by default: core/config/config.inc.php).

      That file tells MODX which database to connect to and sets the other paths and URLs for MODX directories (assets, connectors, manager, etc.).

      For starters, make sure the core directory is where the config.core.php files say it is.

      Then check the paths and URLs in the core/config.config.inc.php file as well as the database name.

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 22840
        • 1,572 Posts
        Quote from: BobRay at Jul 26, 2018, 10:32 PM
        It's an excellent mystery!

        I'm not doubting your story, but I'm having trouble coming up with a scenario that explains your symptoms. Clearing the cache should give you a newer version, not an older one. In other words, say the site is working with the new stuff. If there are no cache files, clearing the cache will have no effect. If there *are* cache files, the the new stuff must already be in the cache (since you're seeing it). If MODX was set to deliver the old stuff (visible once you clear the cache), how did the new stuff get in the cache in the first place?

        "Thought this wouldn't be a problem as I'd downloaded the site from my FTP access. I then added to the new server via FTP and changed all the nessesary config files"

        So the cache would contain the new site as that was from the current site downloaded from FTP, but when the cache was deleted it regenerated it from the database which is 4 months old.

        @anderslimpar, can you get a up to date copy of the database, do you have access to the database via phpmyadmin on the old server so you can take a copy ?

          • 54428
          • 4 Posts
          Quote from: BobRay at Jul 26, 2018, 10:32 PM


          MODX looks in the root config.core.php file to see where the core directory, then it reads the master config file (by default: core/config/config.inc.php).

          That file tells MODX which database to connect to and sets the other paths and URLs for MODX directories (assets, connectors, manager, etc.).

          For starters, make sure the core directory is where the config.core.php files say it is.

          Then check the paths and URLs in the core/config.config.inc.php file as well as the database name.



          Thank you very much for taking the time to reply Bob. I must also say thank you generally as have used many of your guides to get up to speed on ModX - they have been invaluable. So it's great to talk to you.

          I've checked all the connections and all seems (to me) as it should be...
            • 54428
            • 4 Posts
            Quote from: paulp at Jul 27, 2018, 07:15 AM


            So the cache would contain the new site as that was from the current site downloaded from FTP, but when the cache was deleted it regenerated it from the database which is 4 months old.

            @anderslimpar, can you get a up to date copy of the database, do you have access to the database via phpmyadmin on the old server so you can take a copy ?


            This was my fear I guess - the old server was deleted immediately (it's not been a smooth transition between the two sets of IT guys)... I downloaded from FTP all I could from the old server prior to this deletion - but there is no way of getting the database from FTP is there?
              • 3749
              • 24,544 Posts
              Ah, I see how it happened now. Generally, you don't ever transfer the cache directory, but in your case, that showed you the new site content.

              The only good news is that if you still have those cache files you uploaded, they do contain all the new content, which can probably be cut and pasted with a few modifications if you can't access the new DB (the host may have a backup of it).

              If you can get a copy of the new DB, it can be dumped to an .SQL file in PhpMyAdmin (possibly by the host). It will also contain all your new content in plain text that can be cut and pasted.

              The .SQL file (or parts of it) can also be imported, but that's a little riskier.
                Did I help you? Buy me a beer
                Get my Book: MODX:The Official Guide
                MODX info for everyone: http://bobsguides.com/modx.html
                My MODX Extras
                Bob's Guides is now hosted at A2 MODX Hosting