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

    I'm starting "the big move" for 60 Revo websites I made from an old server to new one.
    It's not my first time, and for the second time I used a bash script to make this easy.

    Few years ago, when I used this script, it works like a charm, but this time I have (big) difficulties to make the migration works.

    I will kickly explain what I do on the script :

    • make a sql dump from old server
    • change path on the dump
    • inject the modified dump to the new server
    • unzip last official MODX Revo package to the good place
    • delete core/cache/* files and trunk modx_session
    • copy old MODX conf files to new server
    • change path inside these conf files
    • copy /assets and /core/components directory to new server
    • run the setup from CLI or by hand

    What's going wrong this time ?
    I can access to manager and run the setup from browser without error, but I can't access to the front end !
    If I go to http://domain.tld/index.php?id=22 (the landing page which exist), I have this strange error on Chrome :
    This page is not working.
    domain.tld redirect too much time
    Try delete cookies.
    ERR_TOO_MANY_REDIRECTS

    More informations :

    • The issue is there on Firefox too.
    • I have read https://bobsguides.com/modx-troubleshooting.html and even bought is Sitecheck CMP addon (no error)
    • I have desactivated friendly URL, remove .htaccess and https
    • nothing on the MODX Log too, even with loglevel setted on 4 !!!
    • the issue is there for several Revo Websites, not only one ! I have tested 4 with my migration script
    • the server's structure is nearly the same except the debian version. The only notable change is the change from nginx+apche2 to nginx+Php-fpm for the webserver. I don't know if it could change anything...
    • the best for the end : a fresh Revo install works like a charm smiley

    I'm missing something, but what huh [ed. note: Spheerys last edited this post 7 years, 10 months ago.]
      • 34084 ☆ A M B ☆
      • 756 Posts
      Looks like the friendly URL redirect issue and/or the rewrite rules. Can you check and post your rewrite rules, if you're in Manager you can also turn it off to validate that's the source of the issue.
        Evo Revo // Ubuntu, CentOS, Win // Apache 2x, Lighttp (Lighty)
        Visit CharlesMx.com for latest news and status updates.
        • 28173
        • 409 Posts
        Quote from: charless at Nov 04, 2018, 02:50 PM
        Looks like the friendly URL redirect issue and/or the rewrite rules. Can you check and post your rewrite rules, if you're in Manager you can also turn it off to validate that's the source of the issue.
        I already have desactivated the friendly URL and removed .htaccess !
        Maybe there is something else to do ?
          • 28173
          • 409 Posts
          I wonder if the issue don't come from ngnix+php-fpm...
          Could be possible than on a fresh install, MODX detect this no-apache2 configuration without problem, but during a migration of an existing website, some apache2 conf stuff hidden somewhere (database? conf file?) cause the issue ?
            • 3749
            • 24,544 Posts
            Make sure you have this tag (with the exclamation point) in the head section of all templates:

            <base href="[[!++site_url]]" />


            Make sure whatever page the error_page System Setting points to exists, is published, and is not in any resource groups. Otherwise, you can get an infinite loop like the one indicated in the error message.

              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
              • 28173
              • 409 Posts
              Bob : I add the exclamation point and create a error page with the correct setting.
              Some news : now, I have Error 500 and I have something on modx log :
              [2018-11-05 09:52:40] (ERROR @ /home/SDA/web/domain.lu/public_html/core/xpdo/om/xpdoobject.class.php : 240) Error HY000 executing statement: 
              Array
              (
                  [0] => HY000
                  [1] => 2014
                  [2] => Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
              )
              
              [2018-11-05 09:52:40] (ERROR @ /home/SDA/web/domain.lu/public_html/core/xpdo/om/xpdoobject.class.php : 1452) Error HY000 executing statement:
              INSERT INTO `modx_session` (`id`, `access`, `data`) VALUES ('j75ac01s6no03ik24duf4ok8i5', 1541407960, 'modx.user.0.resourceGroups|a:1:{s:3:\"web\";a:0:{}}modx.user.0.attributes|a:1:{s:3:\"web\";a:5:{s:16:\"modAccessContext\";a:3:{s:2:\"en\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}s:2:\"fr\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}s:3:\"web\";a:1:{i:0;a:3:{s:9:\"principal\";i:0;s:9:\"authority\";s:1:\"0\";s:6:\"policy\";a:1:{s:4:\"load\";b:1;}}}}s:22:\"modAccessResourceGroup\";a:0:{}s:17:\"modAccessCategory\";a:0:{}s:28:\"sources.modAccessMediaSource\";a:0:{}s:18:\"modAccessNamespace\";a:0:{}}}')
              Array
              (
                  [0] => HY000
                  [1] => 2014
                  [2] => Cannot execute queries while other unbuffered queries are active.  Consider using PDOStatement::fetchAll().  Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
              )
              
              [2018-11-05 09:52:40] (ERROR @ Unknown0) PHP warning: Unknown: Failed to write session data (user). Please verify that the current setting of session.save_path is correct (/home/SDA/tmp)
              


              Another resfreh, I had this error :
              Fatal error: Maximum execution time of 30 seconds exceeded in /home/SDA/web/domain.lu/public_html/core/model/modx/modrequest.class.php on line 231

              I have verified than /home/SDA/tmp is writable by user SDA
              I don't understand the others errors... [ed. note: Spheerys last edited this post 7 years, 10 months ago.]
                • 3749
                • 24,544 Posts
                Try manually deleting the cache files again if you haven't already.

                It looks like there's a problem with saving the user session in the modx_session table. Also weird is that the tmp dir is the session.save_path, but it looks like MODX is trying to save the user session to the DB. I don't know what any of that means. Maybe it's normal (though the errors aren't).

                It's very unusual that the Manager works but the front-end doesn't. One thought is that you have an extra that operates in the front end that doesn't play nice with the server, or with the version of PHP at the new site. I'd start by disabling all the plugins by right-clicking on them in the Elements tree, then delete the cache files again. FYI, the CacheClear extra deletes the cache files for you so it's a lot more convenient.

                Sorry, that's all I've got.
                  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
                  • 28173
                  • 409 Posts
                  Quote from: BobRay at Nov 05, 2018, 01:54 PM
                  Try manually deleting the cache files again if you haven't already.

                  It looks like there's a problem with saving the user session in the modx_session table. Also weird is that the tmp dir is the session.save_path, but it looks like MODX is trying to save the user session to the DB. I don't know what any of that means. Maybe it's normal (though the errors aren't).

                  It's very unusual that the Manager works but the front-end doesn't. One thought is that you have an extra that operates in the front end that doesn't play nice with the server, or with the version of PHP at the new site. I'd start by disabling all the plugins by right-clicking on them in the Elements tree, then delete the cache files again. FYI, the CacheClear extra deletes the cache files for you so it's a lot more convenient.

                  Sorry, that's all I've got.

                  Thanks for helping, even if your tips didn't solve the issue or now smiley
                  I have the same behavior after following your recommandations.
                  On this website I'm using xrouting and babel, but even if I desactivate the extensions, the issue is still there.
                  I will try to move another more basic website, just to exclude this "advanced" redirection system provided by xrouting.

                  I will keep it touch smiley
                    • 3749
                    • 24,544 Posts
                    Sorry I couldn't be more help. sad
                      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