We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46577
    • 54 Posts
    One of my sites were hacked before I saw the critical updates sad

    I decided to completely erase the files on the server and re-install as I wasn't confident of identifying all malicious files.

    Downloaded and installed Revo 2.6.5 no problem

    However once I restore my database backup, I get an error

    Fatal error: Call to a member function setProcessingElement() on a non-object in /home2/mysite/public_html/core/model/modx/modelement.class.php on line 253

    Searched for a solution, followed all the advice (clear cache, repair tables, followed this thread https://forums.modx.com/thread/101464/fatal-error-after-renaming-of-manager#dis-post-547492 etc). Nothing works.

    It doesn't seem to matter how far back I go with the backup file. Very annoying.

    (Another possible clue, when I restored the database the first couple of times, manager would log me out and I couldn't get back in. Even sending a recovery email proved futile, the given password was similarly rejected. I ended up reinstalling and restoring my database backup minus the user tables.)

    Any pointers?

    This question has been answered by andytough. See the first response.

    [ed. note: grogorio last edited this post 5 years, 9 months ago.]
    • discuss.answer
      • 38783
      • 571 Posts
      If I understand correctly what you have done I think the problem stems from your database backup belonging to an older version of MODX.

      When you upgrade the files on the server and the database tables are updated. So your restored database is incompatible with the MODX 2.6.5 files you have uploaded.

      Ideally, if you have a backup of your site files and database from before July 18th you should restore the database and files from that backup and then perform an upgrade. The upgrade can be handled by UpgradeMODX 1.5.5-pl: https://modx.com/extras/package/upgrademodx

      If you do not have a full backup of files and database from before July 18th you should:
      1. Download and install the version of MODX you were running from https://modx.com/download/other-downloads
      2. Install any extras you had installed
      3. Upload any assets and assets you require
      4. Restore the old database
      5. Install UpgradeMODX 1.5.5-pl and then run the update to 2.6.5
        If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

        email: [email protected] | website: https://andytough.com
        • 46577
        • 54 Posts
        Thanks for your help Andy. I followed your instructions 1 to 4 and ran into the same problem with the fatal error.

        However I tried again but this time only restored the following tables as a last throw of the dice:

        site_content
        site_htmlsnippets
        site_plugins
        site_plugin_events
        site_snippets
        site_templates
        site_tmplvars
        site_tmplvar_access
        site_tmplvar_contentvalues
        site_tmplvar_templates

        which is probably bad practice but I got my site up again. Menus aren't working yet but I think all that's required is a bit of Wayfinder configuration.

        Installed upgradeMODX and upgraded to 2.6.5 ok so the site is secure for now.

        One strange thing, after the upgrade all my templates appear under the UpgradeMODX category. Not a big deal but had me wondering where the hell my templates were and how come my site is working without them?
        • Fatal error: Call to a member function setProcessingElement() on a non-object in /home2/mysite/public_html/core/model/modx/modelement.class.php on line 253


          That error comes from MODX being unable of loading the parser. Perhaps your database had system settings pointing to use the pdoTools parser, but as you did not yet install pdoTools on the clean installation, that would have caused that error. By more selectively restoring your database you got around that.

          One strange thing, after the upgrade all my templates appear under the UpgradeMODX category. Not a big deal but had me wondering where the hell my templates were and how come my site is working without them?

          Your categories may have a different ID now. You can try importing your categories table as well to restore that.
            Mark Hamstra • Developer spending his days working on Premium Extras and a MODX Site Dashboard with the ability to remotely upgrade MODX and extras to make the MODX world a little better.

            Tweet me @mark_hamstra, check my infrequent blog at markhamstra.com, my slightly more frequent ramblings at MODX.today or see code at Github.
            • 46577
            • 54 Posts
            ok, but I didn't have pdoTools installed at any time
            I tried importing the missing categories but no joy with that
              • 46577
              • 54 Posts
              I've pretty much got a fresh site up and running in a sub-directory, lots of tedious copying and pasting but ultimately faster than trying to troubleshoot the main site.

              Will run it from the sub-direcrtory, or move it to root.

              Thanks all for your help.
                • 3749
                • 24,544 Posts
                The moral of this story is to back up all your files whenever you back up the DB. That way, you have a complete MODX site you can revert to.
                  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
                  • 46577
                  • 54 Posts
                  yes what a sorry tale, I had a backup strategy but not a very good one it seems.

                  and found this in my email spam folder just now, from MODX Systems, sent 6 days ago
                  "Upgrade Your MODX Revolution Sites Now—Critical Security Vulnerability"
                    • 3749
                    • 24,544 Posts
                    Ouch. I feel your pain.
                      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