We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7222
    • 20 Posts
    I'm really pleased with the new ModX 2.2, but moving my updated local copies to a new server has caused me a bit of a headache. I'm aware that some of my issues may be down to my own clumsiness, but I'm wondering if there is a way that the setup process can be improved to help out noobs / idiots like myself.

    According to http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server you should re-run setup after any upgrade, or move. This is great, because it seems to update your core/config/config.inc.php file, no matter what's in there (as long as it is writable of course).

    However, it doesn't seem to update the other 3 config files for you. It seems odd that it will update the core/config file, but not the others. The result of this is often a broken manager. I'm aware (now!) that I should manually check all the config files, but perhaps the setup could be updated to perform the same updates on al the config files automatically. It doesn't raise any alarms if they are set inconsistency.

    Am I understanding how this process should work? I've have been using ModX for some years now and despite the massive improvements found in Revo (especially in 2.2), moving my sites to a new server is a much lengthier process (there are a lot more changes to make). As I said, half my problems are my mistakes, but it was a lot harder to make these mistakes with Evo.

    I'd welcome anyone telling me that I've misunderstood this and that I'm making life unnecessarily tricky for myself!
      • 30319
      • 406 Posts
      Thank you for posting this, I hope it gets some good responses, I've delayed updating to 2.2 because I've seen 'edge case' issues on Twitter and now your comments.

      Thank you, Tom
        • 7222
        • 20 Posts
        Hmm, unfortunately things are actually worse than I had previously thought. If I try to edit a document on my live server I got this:

        Fatal error: Cannot redeclare class modTemplateVarInputRenderText in /var/www/vhosts/castroledge.com/httpdocs/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php on line 10

        Turns out it's my completely paranoid host mucking about with cache permissions, but in an ideal world it'd be great if ModX could notify me of these problems rather than me taking a multitude of stabs in the dark.


        Don't let me put you off upgrading though Tom. It might very well be my unique setup. I will say I've been playing with static templates etc. elsewhere and having a lot of fun!
        • Are you sure you didn't copy the contents of the core/cache or core/packages directories when you moved it? This should be excluded when moving or you will likely have the wrong permissions on those files, depending on how you did the physical move and from where.
            • 7222
            • 20 Posts
            Ah, see I had guessed that you shouldn't move your cache across, but I didn't consider treating core/packages the same way. The guide doesn't say to exclude this, which I think may be the cause of my problems.
              • 38361
              • 4 Posts
              @devolute:

              What did you do to fix the "Cannot redeclare class" error? I'm upgrading a demo site of mine from 2.1.5 to 2.2.0-pl2 and am getting the same error. I started from a freshly-extracted copy of the 2.2.0 release (traditional) unzipped at the location my 2.1 install was installed to, copied in the config files from the 2.1 site and ran through the setup. Everything worked flawlessly, except I can't edit pages without this error popping up:


              PHP Fatal error:  Cannot redeclare class modTemplateVarInputRenderText in <modx>/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php on line 10, referer: <url>/manager/index.php?a=30&id=1
              PHP Stack trace:, referer: <url>/manager/index.php?a=30&id=1
              PHP   1. {main}() <modx>/manager/index.php:0, referer: <url>/manager/index.php?a=30&id=1
              PHP   2. modManagerRequest->handleRequest() <modx>/manager/index.php:75, referer: <url>/manager/index.php?a=30&id=1
              PHP   3. modManagerRequest->prepareResponse() <modx>/core/model/modx/modmanagerrequest.class.php:124, referer: <url>/manager/index.php?a=30&id=1
              PHP   4. modManagerResponse->outputContent() <modx>/core/model/modx/modmanagerrequest.class.php:173, referer: <url>/manager/index.php?a=30&id=1
              PHP   5. modManagerController->render() <modx>/core/model/modx/modmanagerresponse.class.php:117, referer: <url>/manager/index.php?a=30&id=1
              PHP   6. ResourceUpdateManagerController->process() <modx>/core/model/modx/modmanagercontroller.class.php:138, referer: <url>/manager/index.php?a=30&id=1
              PHP   7. ResourceManagerController->loadTVs() <modx>/manager/controllers/default/resource/update.class.php:150, referer: <url>/manager/index.php?a=30&id=1
              PHP   8. modTemplateVar->renderInput() <modx>/manager/controllers/default/resource/resource.class.php:298, referer: <url>/manager/index.php?a=30&id=1
              PHP   9. modTemplateVar->getRender() <modx>/core/model/modx/modtemplatevar.class.php:366, referer: <url>/manager/index.php?a=30&id=1
              


              This hack fixed it for me (wrap class declaration in "class_exists" check), but I would prefer to find an actual solution:
              diff --git a/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php b/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php
              index 2ffc2de..dd244b4 100644
              --- a/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php
              +++ b/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php
              @@ -1,4 +1,6 @@
               <?php
              +if ( !class_exists('modTemplateVarInputRenderText') )
              +{
               /**
                * @package modx
                * @subpackage processors.element.tv.renders.mgr.input
              @@ -8,4 +10,5 @@ class modTemplateVarInputRenderText extends modTemplateVarInputRender {
                       return 'element/tv/renders/input/textbox.tpl';
                   }
               }
              -return 'modTemplateVarInputRenderText';
              \ No newline at end of file
              +}
              +return 'modTemplateVarInputRenderText';
                • 8975
                • 51 Posts
                People, I think we SERIOUSLY need a fast and easy backup/restore option on modx.
                It's really an important thing for me and my clients, both to move things on other servers, and to have a reliable backup on local server.

                At least in evo de sql dump was inside the browser, now I have to enter a damn cpanel or plesk, then move to the database, jump to phpmyadmin and make a dump.
                I want to just make a backup from inside modx!!! Please! smiley
                  Graphic designer, Web designer, Illustrator and Boardgames designer (and illustrator)
                  See my illustrations here: http://erebus74.deviantart.com/gallery/
                  • 7222
                  • 20 Posts
                  @adamlundrigan:

                  Sorry, I forgot how much I hate people who say they fixed the problem without a proper explanation!

                  In my case, what I did was set all the files/folders in cache to 777. Alternatively, if you can delete them that should do the trick (I couldn't in this instance).

                  That might not sort you out, but I'd imagine it's likely to be a cache issue.

                  @erebus:

                  I totally agree. I currently it feels harder than it needs to be, but it also feels like this is an area where ModX has the potential to be easier than something like WordPress (which can also be a little fiddly when moving server).
                    • 10076
                    • 1,024 Posts
                    Anyone find a solution, I have a site, I changed the domain name. All works fine, can edit "almost" anything but hey me resources or pages. Getting this error:
                    Cannot redeclare class modTemplateVarInputRenderText in /home/rocco/domains/paradisodiarolo.com/public_html/core/model/modx/processors/element/tv/renders/mgr/input/text.class.php on line 10

                    Deleted cache (renamed it), checked is is chmod 777, what to do, I have a static MODx site smiley ?

                    I agree too, moving a site from production to live is a pain! Used to be editiinf config.inc.php e basta! Now it s taking me hours going over one error to next. That is not progress in my view. [ed. note: franklos last edited this post 12 years, 3 months ago.]
                      • 10076
                      • 1,024 Posts
                      Okay solved, It was an issue of ownership/chmod. Once that was done everything s back on line. Thanks.