Unable to Connect to Database" Error After Migration

Hi everyone,

I recently migrated my Concrete CMS site to a new hosting provider, and I’m encountering an “Unable to Connect to Database” error when trying to access the site. I’ve double-checked my database credentials in the database.php configuration file, and everything seems correct.

Here are the steps I followed during the migration:

  • Exported the database from the old server and imported it to the new server.
  • Uploaded all site files to the new server.
  • Updated the database configuration file with the new server’s database details.
  • Despite this, I keep getting the error. Has anyone experienced a similar issue? Are there specific settings or steps I might have missed during the migration process?

I also check this : https://forums.concretecms.org/t/unable-to-connect-to-database

Thanks in advance!

Before starting a migration, it is usually safest to disable and clear the concrete CMS caches, disable pretty URLs, and set database entities into development mode.

If you are able to do that on your old site and make new backups, that is the easiest way to get a clean import into the new site database and files.

If not, it is possible to modify these actions retrospectively in the /config, /files and .htaccess for the new host.

The forums post you refer to looks like it is about concrete 5.6. If your site is newer, that forum post can be ignored.

If your site is 5.6, a likely issue is php and MySQL version compatibility. On the other points, the principles are similar except the locations are different and there are no database entities to set into development mode.