Advertisement:

Author Topic: Sporadic DB errors after migrating from old server to new  (Read 311 times)

Offline salamihawk

  • Newbie
  • *
  • Posts: 3
Sporadic DB errors after migrating from old server to new
« on: June 16, 2021, 12:27:10 PM »
Hello,

My hoster has forced me to migrate from an old Debian 8 server to a new server based on Debian 10.

With that came a whole host of other upgrades, namely php7 (7.3.27).

not anticipating any problems (I've been doing this long enough to know better!), I simply copied my old forum and DB over (scp'd the old forum directory, ensured proper owner rights with chown, dumped the old DB in it's entirety and read it into the new MySQL server), made sure apache was running and configured and everything looked OK.

I've noticed, however, that I get sporadic DB errors. I get emails from the system saying:

Quote
There has been a problem with the database!

This is a notice email to let you know that SMF could not connect to the database, contact your host if this continues.

I tried upgrading the forum from 2.0.17 to 2.0.18, but that didn't seem to fully solve the issue. Sometimes if I'm using the forum it seems to work, but then just breaks down in the middle of working fine. Sometimes it just throws an error "database error, try again" or it gives me some error pointing to a specific line in Subs.php. The exact line number kept changing and I don't have an example anymore as my forum appears to be working right at this very moment.

It's not a very high traffic forum. I don't know what the issue is anymore. Does anyone have any ideas?

I've ran the upgrade.php script and it executed successfully and was even able to delete itself, so I'm at a loss.

Offline Sir Osis of Liver

  • SMF Super Hero
  • *******
  • Posts: 11,123
  • We were all equal in the end.
Re: Sporadic DB errors after migrating from old server to new
« Reply #1 on: June 16, 2021, 12:42:21 PM »
If database connect errors are intermittent, that's usually a server issue.  Contact host support, or move to a better host.
“The best laid schemes o' mice an' men / Gang aft a-gley.” - Robert Burns

Offline salamihawk

  • Newbie
  • *
  • Posts: 3
Re: Sporadic DB errors after migrating from old server to new
« Reply #2 on: June 16, 2021, 02:20:08 PM »
Unfortunately the MySQL DB is locally installed, and I’ve got root access to the system, so I’m responsible for whatever this issue is

Offline SpacePhoenix

  • Jr. Member
  • **
  • Posts: 224
Re: Sporadic DB errors after migrating from old server to new
« Reply #3 on: June 16, 2021, 02:46:16 PM »
What errors are you actually getting?

Offline salamihawk

  • Newbie
  • *
  • Posts: 3
Re: Sporadic DB errors after migrating from old server to new
« Reply #4 on: June 16, 2021, 03:54:48 PM »
What errors are you actually getting?

I'm actually trying my best to recreate the problem but I'm just not seeing it right now. I guess I'll have to keep an eye on it.

Offline shadav

  • Support Specialist
  • SMF Hero
  • *
  • Posts: 1,525
  • Gender: Female
    • shadav on Facebook
    • leashadav on GitHub
    • Foamy Fanatics :: For All Your Foamy The Squirrel Needs
Re: Sporadic DB errors after migrating from old server to new
« Reply #5 on: June 16, 2021, 04:17:11 PM »
usually when this happens to me on my hosts its because some resource has gone over its limit
so check your server and database resources/usage

recently it was because the database user is only allowed so many connections so I had to make a new user for each database

any errors in your logs, not smf logs but server logs, hosting account logs