Database connection issue after migrating

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Database connection issue after migrating

Post by designweb »

Hi, I get this error after taking a site from another host onto our server.
I have tried localhost, the IP address, port 3306 and port 0 without any luck.
I've tried php 7.0 and it is currently running php 5.6 as the previous host said it was using php 5.4.
I have cleared the cache directories without success too.

Any ideas would be greatfully appreciated thank you. The database name, username and password are all known and the user does have sufficient privelages to access it. The only file I have edited is config.php since the migration.

Fatal error: Attempt to connect to database cl21-bakers-g on cl21-bakers-g@79.170.40.232 failed in /home/sites/clientsdomainname.co.uk/public_html/lib/adodb.functions.php on line 89 Fatal error: Attempt to connect to database cl21-bakers-g on cl21-bakers-g@79.170.40.232 failed in /home/sites/clientsdomainname.co.uk/public_html/lib/adodb.functions.php on line 89
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Database connection issue after migrating

Post by velden »

First it could help if you can post the system information (if accessible) or at least the version of cmsms (version.php in the install root).

Possible things to check:
Clear the cache: standard procedure after moving a website but I don't remember this problem being caused by cache. Empty the folders /tmp/cache and /tmp/template_c

Make sure in config.php dbms is set to mysqli
https://docs.cmsmadesimple.org/configur ... onfig_dbms
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

$CMS_VERSION = "1.10.3";
$CMS_VERSION_NAME = "Hyacinthe";
$CMS_SCHEMA_VERSION = "35";
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

velden wrote: Fri Mar 12, 2021 1:15 pm Make sure in config.php dbms is set to mysqli
https://docs.cmsmadesimple.org/configur ... onfig_dbms
^my money is on this, did you check it?
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

DIGI3 wrote: Fri Mar 12, 2021 3:17 pm
velden wrote: Fri Mar 12, 2021 1:15 pm Make sure in config.php dbms is set to mysqli
https://docs.cmsmadesimple.org/configur ... onfig_dbms
^my money is on this, did you check it?
Yes that worked which was odd as I was sure I did this yesterday. I know have a different error

Fatal error: 'continue' not in the 'loop' or 'switch' context in /home/sites/clientdomain.co.uk/public_html/lib/classes/contenttypes/Content.inc.php on line 793
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

You'll likely need to lower the php version to 5.6 until you upgrade cmsms to at least 1.12.2. I don't know if that's the issue, but it's a likely culprit.

If the host doesn't let you downgrade the php version then you can try upgrading blindly, or do the updates on a different host then copy the site back again. I've had 1.12.2 run on PHP 7 but I'm not sure I've tried anything older, and some modules will likely cause issues too.
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

Thank you. I've tried with php 5.6 and 7 without any joy so it will need to be upgraded I think.

Is the upgrade process documented somewhere please? Is it a case of making a backup of the site files alone and then ftp'ing some new folders in?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

For old (pre 2.x) versions, there is an an installer that you unzip, then browse to the install folder to run it. You need to do interim upgrades as per: https://docs.cmsmadesimple.org/upgrading/old-versions

Once you're at 1.12.2 you can go straight to the latest version (currently 2.2.15). 2.x installers are now phar based, so you visit the php file on your server and follow the steps.

You will need to do some reasearch to see which of your third-party modules are still supported, and which will need to be removed or migrated. This will be a bit tricky if you can't log into your current admin, so be prepared to restore backups and/or hire help if needed.
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

Sorry which is the install file I need to download as the link just takes me to

http://dev.cmsmadesimple.org/project/list

There are a few download options then

cmsmadesimple-1.12-checksums.datSize:3653
cmsmadesimple-1.12-english-checksum.datSize:155591
cmsmadesimple-1.12-english.tar.gzSize:2958866
cmsmadesimple-1.12-full-checksum.datSize:197339
cmsmadesimple-1.12-full.tar.gzSize:5295495
cmsmadesimple-english-diff-1.11.12-1.12.tar.gzSize:278851
cmsmadesimple-english-diff-1.11.13-1.12.tar.gzSize:245718
cmsmadesimple-full-diff-1.11.12-1.12.tar.gzSize:337404
cmsmadesimple-full-diff-1.11.13-1.12.tar.gz
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

You want either the english or the full (full contains all languages), and not the diffs or checksums. Diffs are for minor updates from the first version mentioned in the filename to the second. Checksums are just checksums.

So, as you're on 1.10.3 now, you'll need cmsmadesimple-1.11.13-full.tar.gz first (or cmsmadesimple-1.11.13-english.tar.gz if you don't need additional languages). When you've successfully upgraded that, go to cmsmadesimple-1.12.2-full(or english).tar.gz.

Make sure to follow all the steps on the "upgrading old versions" page - and it doesn't hurt to look at the instructions for the few versions prior in case you missed those in the past.
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

Thanks for your help.

I downloaded this. Uploaded all of the content to the site and ran /install

I get to put the mysqli database details in and then it errors. I have found 4 modules in the site that were not in the downloaded modules folder and rename to "..._temp" but this hasnt worked.

I've tried with localhost and the server IP address and with port 3306 and without.

Importing sample data... Fatal error: Uncaught Error: Call to undefined function set_magic_quotes_runtime() in /home/sites/bakersleeds.co.uk/public_html/install/lib/classes/CMSInstallPage6.class.php:86 Stack trace: #0 /home/sites/bakersleeds.co.uk/public_html/install/lib/classes/CMSInstaller.class.php(131): CMSInstallerPage6->preContent(Object(pear_ADOConnection)) #1 /home/sites/bakersleeds.co.uk/public_html/install/index.php(163): CMSInstaller->run('install') #2 {main} thrown in /home/sites/bakersleeds.co.uk/public_html/install/lib/classes/CMSInstallPage6.class.php on line 86

Any further ideas please?
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

What PHP version are you using while upgrading?
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

I'm using php version 5.6
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1625
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Database connection issue after migrating

Post by DIGI3 »

That error message is likely from using PHP 7 (the set_magic_quotes_runtime function no longer exists in PHP7) so you'll want to double-check that. You might have an htaccess that's setting the php version to 7.x or something. Do a phpinfo() to be sure.
Not getting the answer you need? CMSMS support options
designweb
New Member
New Member
Posts: 8
Joined: Fri Mar 12, 2021 11:42 am

Re: Database connection issue after migrating

Post by designweb »

Thanks, that was it. I added 5.6 in htaccess and was able to complete the install. I'm left with an admin panel without pages or a template and a site that has a blue cms made simple theme and a tonne of debug code in it.

I'm going to call it a day to be honest but many thanks for your assistance.
Post Reply

Return to “CMSMS Core”