Migrating from one host to another

Permalink
I'm pulling my hair out, and I don't have much left to lose.

I've taken files from the first host and put them on the second one.

I've exported and imported the db.

I've changed the db address in the config/folder (site.php I believe).

When I go to the site (doesn't matter if it's index.php, or index.php/login, or anywhere, I get the following:

============
Unable to connect to database.
A database error occurred while processing this request.

Catchable fatal error: Argument 1 passed to ConfigStore::__construct() must be an instance of Database, null given, called in /home/leonpati/public_html/updates/concrete5.4.2.2/concrete/models/config.php on line 48 and defined in /home/leonpati/public_html/updates/concrete5.4.2.2/concrete/models/config.php on line 136
============

Any ideas?

Thanks in advance!
Dennis

bishopdennis
 
mkly replied on at Permalink Reply
mkly
The error you are getting occurs because concrete5 is unable to connect to the database. This can be due to db password, server, or name as I'm sure you are aware. Double check these just to make sure. Also, just in case, have you already created the new database on the new host?
bishopdennis replied on at Permalink Best Answer Reply
bishopdennis
I figured it out. I did all that I've seen everywhere in the forums. Then I stumbled upon the username & password for the db ... and then I remember when I initially installed the db on the first host that I needed to set privileges.

So, for anyone with this issue. There may be other ways to do it, but I went into mysql databases from the cPanel. I set my db up in there, and then used myphpadmin to import the database. At that point is when I had the problem. I then realized I had to set a USER for the database. I found the USERNAME in the config/site.php file, along with the password. After creating that user in the mysql database page from cPanel, I added the user to the database. When I did that I was asked to set privileges (which are ... ALTER, CREATE, DROP, DELETE, INDEX, INSERT, SELECT, UPDATE).

Amazing ... it all worked. I hope this helps any other novices out there. I got it all done, and I still have a bit of hair left that I didn't pull out. Maybe this will allow you to keep most of yours. :-)