Concrete backup throwing PDO Exception

Hi everyone,

Hopefully someone can help or point me in the right direction.

I tried to install 9.02 with Softaculous. The installation seemed successful but website wouldn’t load. I then went to my backup which I’ve done in the past without issue but this time I’m getting a PDO exception. The backup is version 8.5.4 and php version 7.2.

The error stack trace is:

[21-Feb-2022 22:30:32 UTC] PHP Fatal error: Uncaught PDOException: SQLSTATE[HY000] [2002] Connection timed out in /home/public_html/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:43
Stack trace:
#0 /home/public_html/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php(43): PDO->__construct(‘mysql:host=servername…’, ‘login_name’, ‘password’, Array)
#1 /home/public_html/concrete/src/Database/Connection/PDOConnection.php(22): Doctrine\DBAL\Driver\PDOConnection->__construct(‘mysql:host=servername…’, ‘login_name’, ‘password’, Array)
#2 /home/public_html/concrete/src/Database/Driver/PDOMySqlConcrete5/Driver.php(21): Concrete\Core\Database\Connection\PDOConnection->_construct(‘mysql:host=servername…’, ‘login_name’, ‘password’, Array)
#3 /home/public_html/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Connection.php(360): Concrete\Core\Database\Driver\PDOMySqlConcrete5\Driver->connect(Array, ‘login_name’, ‘password’, Array)
#4 /home/public
in /home/public_html/concrete/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php on line 47

Where “server_name”, “login_name” and “password” are the correct entries. I am also able to login into my sql server.

I looked through this forum and the old and the only fix for a PDO exception was in the old forum but didn’t fix the problem. Any suggestions would be greatly appreciated.

Thank you,

The error is saying it cannot connect to the database.

Check the database info /application/config/database.php

and all info in there are correct.

1 Like

Your trying to connect an 8.5.4 database to a 9.0.2 file system.
If the error was thrown from an 8.5.4 system that error would be thrown from line 46, line 43 is the 9.0.2 system (same file name, different line number).
When you restored the backup did that include all the files or just the database?


Hi katz515,

Thank you for help. Everything in database.php seems to be correct.

Hi ConcreteOwl,

Thank you for your help. I only restored the Concrete files not the database. Basically most everything in the public.html folder.

Oh Thx ConcreteOwl for correcting my previous comment.

I only restored the Concrete files not the database.

@kcmelink what do you mean by “Concrete” files, can you be more specific in terms of paths?

Are you talking about /application/files directory?

I have an another idea that it could be cache which still have some old servers’ info.
If you restored everything under /application/files from previous backups, you may need to delete application/files/cache.

Also as ConcreteOwl said, you had 8.5.4 installed when you made the backups, you should have 8.5.4 core first, or run the upgrade command via command line (such as SSH).

1 Like

There is another possibility that the file system is trying to use core files from the ‘update’ folder.
If there is a file in the application/config folder called update.php try deleting that file to force the system to use the 8.5.4 core files.

1 Like

Thank you for the suggestion. Unfortunately there is not update.php in that folder.

Thank you for your help.

I pretty much follow the directions for moving a site, Moving a website, except that I don’t back up the database.

This was the first time I forgot to clear the cache from within Concrete so I deleted the application/files/cache afterwards but I was still getting the error.

In regards to running the upgrade command via a command line, do you mean version 8.5.4?

I back up all the files in my public_html folder and I’ve included a screen shot of the files from my back up.

If you would like me to take a look at this for you I will need copies of the files backup and the database, I can give you access to my Dropbox for you to upload the zipped files or you can give me access to the server so I can get the copies for myself.
Let me know if this is of interest to you.

1 Like