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

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:

Code:
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.webp

Any help is, of course, appreciated.
 
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.
 
Looks like the posting problem is because the final 3 columns in the post table don't exist. I'm running
Code:
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?
 
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.
 
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).
 
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.
 
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.webp

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?
 
Back
Top Bottom