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

    Am I right in thinking the only thing I would need to do to change database for my modx application is change the connection in the config.inc.php file?

    I tried doing this and my site just hangs when you try and click a link?

    Any ideas....do I need to update the DB details somewhere else?

    Cheers,

    Justin
      • 6726
      • 7,075 Posts
      It should not be a problem, unless the DB you’re trying to connect to is on a different server (never tried that, and don’t know if we handle external database -> also, you’d have to check with your host about that, lots of them do not allow it).

      Of course, another obvious thing is you have to point to a DB with the correct structure (which means, created with a similar version of MODx, beware of differences in DB structure from one version to another, you’ll have to run a proper upgrade in that case).

      Last but not least, check the $site_sessionname = "SN************"; matches the one in the DB for the site_id field in modx_system_settings (You’ll note the site_id is prefixed with SN in the config file, add the site_id after the SN)
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 15083
        • 697 Posts
        Hi davidm,

        Thanks for the quick reply. Basically what I am doing is this. Im switching host completly. I was not planning on changing the version of modx....what I was planning was:

        1) Changing the DB connection details to get the site working from the new DB (So yes the DB server is running on a different machine)
        2) With the adove working I could then just move the files to a new host and point the name server....knowing its all gonna be fine......but alas its not!

        Ill have another go at it later on and let you know how I get on......

        Cheers.
          • 15083
          • 697 Posts
          Hi......

          now im a bit confused......there is no site_id field in ’the modx_system_settings’? Im working on version 9.1.

          Also I will be working with an external database (ie on not hosted on the same server) and it has worked fine for me in the past.

          Cheers,
            • 6726
            • 7,075 Posts
            Check the second page wink

            You’re seeing records from 0 to 30, if I remember correctly, it’s on the second page...

            This being said, it seems your problem is connecting to an external DB : connecting from you current host files to your future host DB ?
            Not sure this can be done. Easiest thing is, switch altogether... let the actual install in place, make a new install @ your new host, import your DB into it, then when you’re alright modify your DNS...
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l'outil id
              • 727
              • 502 Posts
              Quote from: davidm at Oct 08, 2006, 12:11 PM

              It should not be a problem, unless the DB you’re trying to connect to is on a different server (never tried that, and don’t know if we handle external database -> also, you’d have to check with your host about that, lots of them do not allow it).

              Yes, it works (providing the database host allows external access). I have a MODx site running on a web host who keeps the MySQL databases on seperate servers to the web sites.

              Andy
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Come to think of it, the very first MODx site I ever did also has the database server on a different server than the website itself. There is no difference, it just needs the hostname of the database server instead of "localhost".
                  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
                  • 6726
                  • 7,075 Posts
                  It can work, but lot of shared hosting service won’t allow it...
                    .: COO - Commerce Guys - Community Driven Innovation :.


                    MODx est l'outil id
                    • 15083
                    • 697 Posts
                    davidm.....your a clever man....and im a silly one. Yes indeed the site_id is on the second result page wink

                    ajayre, bot yourself and dave had hit on the problem. The site is just hanging when I move to the new external database. However I am about 98% sure they only allow connections from approved ip ranges (ie the hosting they sold you!)

                    So I think it will have to be plan "B"......take daves advice and install modx with the new host......and bring my pages and content over!

                    thanks for all the help.

                    Justin.