We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36924 ☆ A M B ☆
    • 298 Posts
    Using Revo 2.2.11 and PHP 5.3.10, I tried to move site from my local machine to the host cPanel. Checked that config file settings are correct, still I get one single error: Database Connection Failed!

    In the documentation here: http://rtfm.modx.com/revolution/2.x/getting-started/installation/troubleshooting-installation you are advised to avoid all underscores as this results in errors at times. Unfortunately the server setup is shuh that there is an existing preffix (accountUsername_) before the input form for supplying Database name, Database Username except for password.

    Also in the recent past I uploaded about three other version 2.2.11 without this sort of challenge, mostly under 10 minutes.

    Kindly advise. [ed. note: ojchris last edited this post 12 years, 2 months ago.]
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      Hello,

      The first thing you might want to do is upgrade to 2.2.15 or 2.3.0, which helps with server support (among other things). That being said transferring the site to a cPanel server isn't very difficult, but you can encounter some problems depending on how you do it.

      I generally upload a zip file of the site to the public_html directory and extract it using cPanel/shell access. This minimizes file corruption during the upload, and puts everything where it needs to be (assuming the core is in webroot). Once uploaded you will want to verify the file/folder permissions are correct - if you extract a zip they normally get set correctly.

      Once the files are in place make sure you update the config files (/config.inc.php, connectors/config.inc.php, manager/config.inc.php and core/config/config.inc.php). There are multiple paths that will need to be updated, not to mention your database information.

      For the database I generally use the Database Setup Wizard in cPanel, the main reason ensuring everything gets created (user, database, and permissions). It's easy to forget a step, and yes I have forgotten them before despite too many MODX installs. The biggest problem I see is with the password being too weak, or containing special characters that could break it. Make sure your password lacks the ' or ; as they could cause you problems.

      In regards to the usernames, I haven't had any problems with the cPanel prefixing to date. You can disable this in cPanel 11.44 if you want, but I wouldn't recommend it personally. Naturally, once the database is setup make sure you upload your sql file for the site.

      Your install should run properly at this point in time, however you can also run the installer again in upgrade mode just to make sure everything is happy. Oh, and don't forget to delete the cache folder located in your core directory. We can't have an old cache breaking your shiny new site smiley

      Hope that helps smiley
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 36924 ☆ A M B ☆
        • 298 Posts
        Massive detailed help. Thanks AMDbuilder. Just as mentioned transferring MODx is a breeze. This is my first time experience having to get stocked.

        But I just might have forgotten this part:
        Once the files are in place make sure you update the config files (/config.inc.php, connectors/config.inc.php, manager/config.inc.php and core/config/config.inc.php).
        .

        I only updated the config in the core (which happen to be outside root) and forgot others. Will update asap.
          • 1343 ☆ A M B ☆
          • 2,213 Posts
          Just following up did you manage to get everything working?
            Patrick | Server Wrangler
            About Me: Website | Tweets |  MODX Hosting
            • 36924 ☆ A M B ☆
            • 298 Posts
            Most appreciated.

            I spent another Five (yes 5) hours trying to resolve this yesterday, without any luck. Updated the configs as expected, and deleted previous files and database on the Server and did an upgrade to 2.2.15 as you suggested (2.3 seem rather unable for now, IMO) on my localhost, moved the upgraded files to server as ZIP and imported the DB. This guy doesn't still connect. I even added the port=3370 suggestion I saw on the documentation.

            After doing what I believe is the best MODx job I've done till date, I'm getting frustrated by this debacle. All my previous MODx setup were simply a breeze and Advance setup.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              1. There actually is a MySQL database engine running (yes, I've run across that situation a couple of times)
              2. The hostname for the database is correct - usually "localhost", but not always
              3. Database name - usually on CPanel it's some variation of <domainname>_dbname
              4. Connection charset - same as the database charset, should be utf8
              5. User name - again, usually on CPanel something like <domainname>_dbuser
              6. Password - shouldn't need an explanation.
              7. The $database_dsn line is also correct, like
              $database_dsn = 'mysql:host=localhost;dbname=mydb_name;charset=utf8';

              Are you sure that when you created the database user you gave him the permissions needed?
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 36924 ☆ A M B ☆
                • 298 Posts
                This guy gets to Install Options (which is readily selected as Upgrade Existing Install) and on clicking next I get:
                500 Error
                Site temporarily unavailable.

                Very strange as I have about four other sites on the same server running MODx revo. The last site was on a 2.2.6 MODx version. [ed. note: ojchris last edited this post 12 years, 2 months ago.]
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Sounds like it can't find the config.inc.php file.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org