XF 1.5 Help me restore and fix database

borgqueenx

Active member
First off, i could really use some help in phpmyadmin to restore the database. i have tried to put back a xenforo backup sql file after deleting the current one but it does not let me. i get a blank screen when using the import method.

After thats done, im getting tired of a currupt table thats always xf_session that gets damaged at every server reboot i do(normal reboot)

Please help!

EDIT: cannot restore database! exceeded max_allowed_packet. when i try to set this value, it makes the server not work anymore. help :(

EDIT2: Got that working. database imported successfully with no errors anymore in phpmyadmin. But my site still shows "unexpected error". please help!

EDIT3: restores server files and from backup but not working. now i really dont understand as when i made this backup everything was running fine. Where can i see whats causing this Unexpected error?
my site is http://cupcakethunder.eu/
I should add that the xenforo also stopped working somewhere midnight without something seemed to be happening to my server.
 
Last edited:
i cannot access the xenforo control panel. if you mean from the server please give me the location and i will tell the error...
edit: a file name would also help, then i can just perform a search.
EDIT: i just discovered that when vistting http://cupcakethunder.eu/admin.php i get this:
Server Error
Mysqli prepare error: Table 'cct_xenforo.xf_session' doesn't exist

  1. Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
  2. Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
  3. Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
  4. Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 825
  5. Zend_Db_Adapter_Abstract->fetchOne() in XenForo/Session.php at line 790
  6. XenForo_Session->getSessionFromSource() in XenForo/Session.php at line 484
  7. XenForo_Session->_setup() in XenForo/Session.php at line 468
  8. XenForo_Session->start() in XenForo/Session.php at line 324
  9. XenForo_Session::getPublicSession() in XenForo/ControllerAdmin/Login.php at line 7
  10. XenForo_ControllerAdmin_Login->actionForm() in XenForo/FrontController.php at line 351
  11. XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
  12. XenForo_FrontController->run() in /home/cct/public_html/admin.php at line 13

And the above is correct. there is no xf_session table somehow. Is this fixable? it didnt put it back with the backup restore somehow...
 
Last edited:
I'd be concerned with why that table is missing from the restore and what that may mean for other parts of the backup, though the table itself doesn't hold any permanent data. Is there an xf_session_admin table? How about xf_search_index?
 
Both xf_session_admin and xf_search_index exist. i guess the xf_session was not backed up as phpmyadmin always marks it as crashed.
Is there a way to re-create this table?

That was going to be my second question. after getting the site back up i hope i can get rid of this problem that xf_session causes these problems with me.

But first the site...
 
Code:
CREATE TABLE `xf_session` (
  `session_id` varbinary(32) NOT NULL,
  `session_data` mediumblob NOT NULL,
  `expiry_date` int(10) unsigned NOT NULL,
  PRIMARY KEY (`session_id`),
  KEY `expiry_date` (`expiry_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
 
Code:
CREATE TABLE `xf_session` (
  `session_id` varbinary(32) NOT NULL,
  `session_data` mediumblob NOT NULL,
  `expiry_date` int(10) unsigned NOT NULL,
  PRIMARY KEY (`session_id`),
  KEY `expiry_date` (`expiry_date`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
im really relieved that rebuilding this table made my website work again like a charm. Thanks alot!

But now please help me get rid of this error once and for all. Why does the xf_session gets corrupt/damaged at a normal(not forced) system reboot? why does it then still work a while after a reboot before it crashes? I need to find whats causing this table only to get messed up and fix it, because this is already the third time its happening to my site. always xf_session.
 
I would personally export the whole database, create a new database, and import back into the new one. Change your XenForo config to then point to the new database. Could be a drive issue, and importing to the new database will put the tables into new file space on the drive. This has worked for me in the past where the session table was crashing frequently.
 
I would personally export the whole database, create a new database, and import back into the new one. Change your XenForo config to then point to the new database. Could be a drive issue, and importing to the new database will put the tables into new file space on the drive. This has worked for me in the past where the session table was crashing frequently.
Well i already did a full restore to try to get my site back up, so removed database and recreated it.
 
Is MySQL restarting unexpectedly?

Ultimately it's something server related so your host or sysadmin will be best placed to investigate.
 
Top Bottom