We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38590
    • 22 Posts
    Hi all, trying to move my dev site to live server with http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server but I'm having some trouble.

    My templates are displaying, and static resources are being displayed too, but other content not.
    Also, if I go to /manager, i just get a blank screen.

    I've been going through /manager/index.php and found that, on line 75:
    if (isset($modx) && is_object($modx) && $modx instanceof modX) {
        if (!$modx->getRequest()) {
            $modx->log(modX::LOG_LEVEL_FATAL,"Could not load the MODX manager request object.");
        }
        if (!MODX_API_MODE) {
    75        $modx->request->handleRequest();
        }
    }
    


    There seems to be a problem: if I put an echo() before it, it shows the echo, if I put one after it, it doesn't.

    Any ideas or help?
    Thx in advance.
      • 38590
      • 22 Posts
      Ok, they moved the site to a new server and told me it works if they change the permissions to 777 for all files and folders.

      My guess is: MODx needs to be able to write to some files. It worked locally because MODx created those files. But by transferring through ftp, the ftp user is now the owner of every file and folder on the server, so those files are not writable for MODx.

      Can someone tell me which files and folders need to be owned by MODx?

      If someone has another theory, idea or tip for just making my site work online, do share laugh

      Thx
        • 30912
        • 463 Posts
        Your server should still work even if you reuploaded all of the files via FTP - ive done it a few times and then dropped in the database and upgraded the install.

        I would try the following (if you can be bothered if not skip to step 3)

        0: Check your core.config.php file for the file paths in the config file matches the correct path for the server
        1: upload a fresh install of all of all the MODx files to you server.
        2: set the access permissions for your install as per the setup guide i.e cache etc.
        3: run setup frmo mysite.com/setup
        4: see if that fixes the issue
        5: if it doesnt, check your core.config.php file again for the paths
        6: amend paths and run setup.


          • 38590
          • 22 Posts
          Hey Tyreal, thanks for your response

          Quote from: Tyreal2012 at Feb 27, 2012, 04:31 PM

          Your server should still work even if you reuploaded all of the files via FTP - ive done it a few times and then dropped in the database and upgraded the install.

          Is it always necessary to re-run the setup, even when not upgrading? I think it's kinde confusing because /setup is always removed after installation.

          0: The file paths gave problems before, but I corrected them, that's when the templates and the static resources started to show.
          1: Someone from the helpdesk of the hosting company seems to have uploaded a fresh install of MODx, but I am only able to select a fresh installation instead of an upgrade. I need to run an upgrade, right? Is this so that files would be owned by MODx again, rather than the ftp user who uploaded the files?
          If you want to upgrade, do you need to upload the files with ftp in a "special way"? (e.g. so that files that have been altered during development don't get overwritten by "fresh files"?) And if so, how do you do that? Because, all fresh files will be newer and file size isn't really a trustworthy parameter either to detect which files belong to the developed site or the fresh install
            • 3749
            • 24,544 Posts
            You always want to run Setup when moving a site in order to straighten out the paths. Be sure to use the version of Setup that goes with the version you're moving.

            My guess is that your host removed the core/config/config.inc.php file. That will make MODX think it's a new install. DON'T run the install unless you can check 'Upgrade' or you'll lose your content.

            Hopefully, you or the host have a backup of the config.inc.php and can replace it.


            ---------------------------------------------------------------------------------------------------------------
            PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
            MODX info for everyone: http://bobsguides.com/modx.html
              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
              • 30912
              • 463 Posts
              When upgrading i reupload ALL files and then run setup.

              I think Bob is right which would explain the lack of an upgrade option - we have our own server so are not reliant on other people so if anyone cocks up its my fault (as i put sites live)

              Dropping your original config file in should prompt for an upgrade if you have it - ive just done the same thing and it worked for me.

              GL smiley
                • 38590
                • 22 Posts
                BobRay:
                So I don't need to upload the whole MODx installation, only the setup folder?

                Tyreal:
                What's the advantage of re-uploading all files and folders? Isn't there any danger of overwriting any altered files? (altered during development)

                Am I correct to say, that if I re-run /setup, I won't need to do the steps "Updating your Config Files" and "Update your Database" from http://rtfm.modx.com/display/revolution20/Moving+Your+Site+to+a+New+Server


                Me and a guy from support already thought it was weird that this path to the modx root needed to be updated in 10 different places, instead of just 1 variable...

                Thx again for supporting
                  • 30912
                  • 463 Posts
                  core files shouldn't have been altered anyway, i think we've only ever hacked the core files on any install maybe 2/3 times over about 60 sites - but yes it would overwite any hacks any file overwrite would.

                  If you are just updating the paths you on only need /setup, if your updating the install version as well then you need ALL the files.

                  You should always check the paths as per the RTFM even with the setup - the main thing the setup wizard does is set the database path - it doesnt always set the Config paths (from experience)
                    • 3749
                    • 24,544 Posts
                    Me and a guy from support already thought it was weird that this path to the modx root needed to be updated in 10 different places, instead of just 1 variable...

                    I assume you're talking about the three config.core.php files and the main config file. The reason it needs to be done in several places is that in Revolution, you can move and rename several of the main directories. MODX has no way of knowing where you moved them to or what you named them (except in the Advanced distribution, where MODX is moving them for you).

                    This stuff is only important if you either move the directories around, or copy a site from another location as you did. In those cases, the existing paths are wrong and need to be corrected.

                    If you did a clean install of MODX with the directories in the default locations, none of that would be necessary.


                    ---------------------------------------------------------------------------------------------------------------
                    PLEASE, PLEASE specify the version of MODX you are using . . . PLEASE!
                    MODX info for everyone: http://bobsguides.com/modx.html
                      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
                      • 38590
                      • 22 Posts
                      Tyreal: Oh, ok, I thought that modx would write to some of those files during installation and development (as with the paths).

                      BobRay: I was blind but now I see wink