Hi guys, it's been a while since I've been here but I am hoping someone can help me resolve an issue. I have a backup of an older UBB version. I had all the files backed up and the database backed up. I recently had a need to temporarily re-install that from backups to look at something in my forum posts there, but have run into a snag.
I have uploaded all the files and database to my server, but when I try to go to my forum index file I get the following (See attached)/ In case the attachment doesn't work, it basically says:
UBB Message We encountered a problem. The reason reported was Database error only visible to forum administrators Please click back to return to previous page.
My question to you all is, how can I see this error when I can't get logged in? In cPanel, the error log doesn't show any database errors so maybe DB error are accessible from somewhere else? Any help is greatly appreciated.
UPDATE: Upon closer look, I did find a related error in error logs:
[Sat Mar 24 18:26:23.737975 2018] [cgi:error] [pid 11836] [client XX.XX.XX.XX:XXXX] AH01215: PHP Fatal error: Call to a member function error() on null in /home/xyz/public_html/ubforum/libs/mysql.inc.php on line 77: /usr/local/cpanel/cgi-sys/ea-php56, referer: http://www.blahblah.com/ubforum/admin/
Line 77 seems to be the $admin->error( $errstr ) in the following code:
PHP Code
global $admin, $html;
if (defined('IS_ADMIN')) {
$admin->error( $errstr );
} else if (defined('IS_IMPORT') || defined('IS_UPGRADE')) {
echo '<b>SQL Error:</b> ' . $errstr;
} else {
if (!is_object($html)) {
$html = new html;
}
if (defined('NO_WRAPPERS')) $is_bare = true;
( $is_bare ? $html->not_right_bare( $errstr ) : $html->not_right( $errstr ) );
}
}
To display errors when MySQL logging is off (or hasn't been enabled) you'd need to make a small change to an embedded variable In /libs/mysql.inc.php change:
Code
$showerror = 0;
to
Code
$showerror = 1;
You'll want to reverse this change once everything is worked out.
Looks like all the tables didn't import (Or if I screwed up when I did the last backup I may be screwed unless I get lucky and can find an older DB backup.
Yes and no. the xyz is really something else, but I obfuscated it for posting on a public forum. But the database in question has the exact same name as was in the error. Now, I just tried to re-import the database to see if I can all the tables, but I got this in PhPMyAdmin:
SQL query:
-- -- Dumping data for table `ubbt_ANNOUNCEMENTS` --
Are you attempting to import a backup through PHPMyAdmin? You'll likely hit the PHP max execute time if using a large database.
I would recommend importing a database via command line vs through a web script; I have some instructions in the "Import Database section of the "Migration Guide" at UBBWiki:
Quote
Now that the old files are on the new server, you need to import your database; you can again use PHPMyAdmin or use the command line to import the database. The command line way of doing this (note, this is not the MySQL command line, simply the Linux command line) would be:
Code
mysql -h localhost -uuser -ppass database_name < databasebackupfile.sql
Entirely possible if you did it through PHPMyAdmin and the database wasnt fully exported. I generally either export/import via command line or SQLYog (when SSH access is not provided).
It'll also throw an already exists error if you're importing into a database which already has data in it as you cannot import a UBB.threads database over a UBB.threads database.
Basil, You also need to undo the show error that Gizmo showed you. It is a temporary measure if you don't have error logs turned on. It will show any member/guest the same info.
Last edited by Ruben; 03/25/20185:04 PM.
Blue Man Group There is no such thing as stupid questions. Just stupid answers
Thanks guys. I think I have to conclude that when I backed up the db I did not get the entire db so am essentially dead in the water. Oh well, lesson learned (PS: I did turn off the debug).