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

XF 1.3 Database restored, but can't log in to admin or create threads

Discussion in 'Troubleshooting and Problems' started by Coop1979, Dec 11, 2014.

  1. Coop1979

    Coop1979 Well-Known Member

    I had a database snafu this week and my data was restored this afternoon thanks to some help from a freelancer. I can view various parts of my forum, but when I click on Reply or Create Thread I get the following error:

    Mysqli prepare error: Unknown column 'last_edit_user_id' in 'field list'
    Zend_Db_Statement_Mysqli->_prepare() in Zend/Db/Statement.php at line 115
    Zend_Db_Statement->__construct() in Zend/Db/Adapter/Mysqli.php at line 381
    Zend_Db_Adapter_Mysqli->prepare() in Zend/Db/Adapter/Abstract.php at line 478
    Zend_Db_Adapter_Abstract->query() in Zend/Db/Adapter/Abstract.php at line 574
    Zend_Db_Adapter_Abstract->insert() in XenForo/DataWriter.php at line 1624
    XenForo_DataWriter->_insert() in XenForo/DataWriter.php at line 1613
    XenForo_DataWriter->_save() in XenForo/DataWriter.php at line 1405
    XenForo_DataWriter->save() in XenForo/DataWriter/Discussion.php at line 477
    XenForo_DataWriter_Discussion->_saveFirstMessageDw() in XenForo/DataWriter/Discussion.php at line 426
    XenForo_DataWriter_Discussion->_postSave() in XenForo/DataWriter.php at line 1409
    XenForo_DataWriter->save() in XenForo/ControllerPublic/Forum.php at line 679
    XenForo_ControllerPublic_Forum->actionAddThread() in XenForo/FrontController.php at line 347
    XenForo_FrontController->dispatch() in XenForo/FrontController.php at line 134
    XenForo_FrontController->run() in /Sites/mysite/index.php at line 13
    I have a feeling this is perhaps because she used the structure of my previous mysqldump (from May) to load the InnoDB data from my 1.3.2 installation. I've already had to create a few tables that were missing. I just can't figure out what table this error is referring to.

    Would this all correct itself if I updated to 1.4.x?

    Also, I can't log in to my admin. Instead of the styled version of the admin, I'm getting a white screen with 2 boxes for login, but after I enter my credentials, I just get a refreshed page and a "M" on the screen in place of an error. Nothing being filled in the error log, either.
    Screen Shot 2014-12-11 at 4.18.27 PM.png

    Any help is, of course, appreciated.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    If I remember correctly, the ACP issue is related to incorrect db config for the ip changes.

    Really what you need to do is run a schema compare between your existing database and a clean db of the same version.
    That will then indicate where the issues are and what needs correcting.
    Coop1979 likes this.
  3. Coop1979

    Coop1979 Well-Known Member

    Looks like the posting problem is because the final 3 columns in the post table don't exist. I'm running
    ALTER TABLE xf_post ADD (
      `last_edit_date` int(10) unsigned NOT NULL DEFAULT '0',
      `last_edit_user_id` int(10) unsigned NOT NULL DEFAULT '0',
      `edit_count` int(10) unsigned NOT NULL DEFAULT '0');
    right now to see what else I run against.

    Any suggestions on how to run the schema comparison?
  4. Coop1979

    Coop1979 Well-Known Member

    Now I'm getting this when trying to post or reply.
    Mysqli statement execute error : Incorrect integer value: 'GD(i' for column 'ip' at row 1
  5. Mike

    Mike XenForo Developer Staff Member

    last_edit_user_id was added in 1.2. That would imply that the structure used was from 1.1. There are a ton of schema changes to account for then, and potentially data conversions but I couldn't really comment as to what would be necessary as it sounds like the data is a mess.
  6. Coop1979

    Coop1979 Well-Known Member

    Hi @Mike, how do I determine what version of XF the data is from? Is that housed in a table somewhere?

    I think the data is good. The schema that the data went into is bad.
  7. Mike

    Mike XenForo Developer Staff Member

    The data version is in xf_option, option_id is currentVersionId.

    But yeah, it seems like the schema is bad. But as before, I couldn't really give any recommendations as I have no idea what was done (or how you really have data from one version get restored into a schema from an older version).
    Coop1979 likes this.
  8. Coop1979

    Coop1979 Well-Known Member

    The schema was definitely bad, but the data showed that it was from 1.3.2. Working on re-building everything again now.

    Thanks for the pointers so far.
  9. Coop1979

    Coop1979 Well-Known Member

    I've had the database reimported and things seem to be much better, but there are two things that stand out:

    1. My forums show the threads in Ascending order (oldest first) instead of Descending (newest threads first).
    2. I'm getting an error when trying to create a thread. "Please select a Prefix". On forums where I do actually have thread prefixes, I can post threads. On forums where I don't have thread prefixes, I get this error:

    Screen Shot 2014-12-12 at 4.46.26 PM.png

    I am going to be doing an update to 1.4.x soon anyway, so is there a chance these issues will rectify themselves while going through the upgrade process? Do the upgrade scripts check the validity of tables or anything like that?
  10. Brogan

    Brogan XenForo Moderator Staff Member


    Only a schema compare will be able to tell you what is incorrect.
  11. Coop1979

    Coop1979 Well-Known Member

    Nevermind, I found out where the issues originated.

Share This Page