News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Moving to a new host : Can't connect to the database

Started by 420SA, January 11, 2018, 03:28:40 AM

Previous topic - Next topic

420SA

Hi guys perhaps you could please assist me

I'm in the process of moving to another hosting provider. I have copied over all the files and database. Set all privileges etc but I can't seem to connect to the database when I run repair settings.

It tells me "Some settings are not being shown because the database connection information is incorrect. Check your database login details, table prefix and that the database actually contains your SMF tables." It also says "SMF N/A Settings Repair Tool" at the top so its not able to pick up what forum version it is.

I've doubled checked everything many times and changed the password several times. Nothing helps.

What could be causing this?

aegersz

i'm in Australia, the other timezone and not part of SM support (I think they sleep every now and then  ::)) but will try to help. You may need to modify Settings.php in the web root directory.

The password to your database may have changed so try to edit that file accordingly - it is the variable $db_password.

there are other variables there too ($db_user etc.) and they all have to match your new environment.

those settings are outside the scope of repair_settings.php and have to be configured first.

you may need to discuss this with your host, your admin or yourself  :P.

it's usually a very common problem that i have had myself.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

420SA

Quote from: aegersz on January 11, 2018, 03:54:40 AM
i'm in Australia and not part of SM support but will try to help. You may need to modify Settings.php in the web root directory.

The password to your database may have changed so try to edit that file accordingly - it is the variable $db_password.

there are other variables there too ($db_user etc.) and they all have to match your new environment.

those settings are outside the scope of repair_settings.php and have to be configured first.

you may need to discuss this with your host, your admin or yourself  :P.

it's usually a very common problem that i have myself.

Thanks for your input but unfortunately I've checked that. Everything in the settings.php file reflects the details of the new environment(db name, user and password) and yet it doesn't connect to the DB. If I try to access the forum I just get a blank white page.

aegersz

can you confirm that the database is accessable and available somehow ?

do you have access to phpmyadmin, for example ?

$db_server, $db_prefix too ?

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

420SA

Could it be URL related? The domain is still pointing to the old server but I've edited my hosts file on my PC in order to access the website on the new server

420SA

Quote from: aegersz on January 11, 2018, 04:19:24 AM
can you confirm that the database is accessable and available somehow ?

do you have access to phpmyadmin, for example ?

$db_server, $db_prefix too ?

Yes I have access to phpmyadmin. The database is there under the correct name with all the required tables. The database is also assigned to a user... is there a possibility that the database may still be inaccessible?

aegersz

no. if you see it in phpmyadmin and can display the tables then it is considered available ... run the browse facility to check for populated table data if in doubt.

did you check $db_prefix ? (table prefix with "_" [underscore])

is it on the local host or via a port number ?
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

420SA

Quote from: aegersz on January 11, 2018, 04:28:33 AM
no. if you see it in phpmyadmin and can display the tables then it is considered available ... run the browse facility to check for populated table data if in doubt.

did you check $db_prefix ? (table prefix with "_" [underscore])

Yes

Arantor

If the screen is white, that doesn't reflect a could not connect problem. Check your host error log.

420SA

Quote from: Arantor on January 11, 2018, 04:34:28 AM
If the screen is white, that doesn't reflect a could not connect problem. Check your host error log.

I checked under Metrics => Errors in the Cpanel and no errors show. Is there some other error logs I should be checking?

aegersz

Arantor wants you to look for PHP errors as they are the most common cause of white screens. They could be the webserver logs (Apache for example) or messages (a common Linux log). Your host will know where to find PHP errors.

IME, database connectivity errors also result in whitescreens too so you have to do some digging, even if by proxy c/o your host.
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

420SA

I did the transfer to another host I'm using for another site and the transfer was a success. Something must have gone wrong with the transfer process

Thanks for your help though guys I'm sure I'll find the fix

aegersz

good job to try again because i was out of ideas.

i don't know how Arantor and his team stay sane with all the different issues, let alone the ones that are caused by inexplicable and unpredictable errors.

much luck with your migration

Einstein said that one sign of madness was doing the same thing and expecting a different outcome but then he didn't have silly computers back then !
The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

Advertisement: