1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Help me restore and fix database

Discussion in 'Troubleshooting and Problems' started by borgqueenx, Dec 24, 2015.

  1. borgqueenx

    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: Dec 24, 2015
  2. Mike

    Mike XenForo Developer Staff Member

    You'll need to log into the control panel and view the server error log there to get a more detailed error message.
     
  3. borgqueenx

    borgqueenx Active Member

    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: Dec 24, 2015
  4. Mike

    Mike XenForo Developer Staff Member

    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?
     
  5. borgqueenx

    borgqueenx Active Member

    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...
     
  6. MattW

    MattW Well-Known Member

    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
     
  7. borgqueenx

    borgqueenx Active Member

    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.
     
  8. MattW

    MattW Well-Known Member

    Dedicated server? VPS? Shared hosting?
     
  9. borgqueenx

    borgqueenx Active Member

    I have KVM VPS on centos 6 with centos web panel.
     
  10. MattW

    MattW Well-Known Member

    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.
     
  11. borgqueenx

    borgqueenx Active Member

    Well i already did a full restore to try to get my site back up, so removed database and recreated it.
     
  12. borgqueenx

    borgqueenx Active Member

    anyone else got ideas what the cause might be?
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    Is MySQL restarting unexpectedly?

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

    borgqueenx Active Member

    is there a way to check that? does mysql have a log?
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

    If you don't know how to check that then I suggest contacting your host for support.
     
  16. Tracy Perry

    Tracy Perry Well-Known Member

    It does if you tell it to use one in the my.cnf
    Mine is /var/log/mysqld.log
     

Share This Page