XF 2.0 xf_addon table somehow got deleted

Long story short, made the jump to 2.0. Made a backup of our old database, and then our backup drive decided to fail on us. So, now I'm stuck with a dead backup drive and a non-functional XF install.

With no backup, I'm forced to stick with what I have. I receive this error:

XF\Db\Exception: MySQL statement prepare error [1146]: Table 'xenforo.xf_addon' doesn't exist in src/XF/Db/AbstractStatement.php at line 212
  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 174
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 35
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 46
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 69
  5. XF\Db\AbstractAdapter->query() in src/XF/Mvc/Entity/Finder.php at line 1138
  6. XF\Mvc\Entity\Finder->fetch() in src/XF/Repository/TemplateModification.php at line 52
  7. XF\Repository\TemplateModification->applyModificationsToTemplate() in src/XF/Entity/Template.php at line 185
  8. XF\Entity\Template->validateTemplateText() in src/XF/Entity/Template.php at line 166
  9. XF\Entity\Template->verifyTemplate() in src/XF/Mvc/Entity/Entity.php at line 713
  10. XF\Mvc\Entity\Entity->_verifyValueCustom() in src/XF/Mvc/Entity/Entity.php at line 567
  11. XF\Mvc\Entity\Entity->set() in src/XF/Mvc/Entity/Entity.php at line 502
  12. XF\Mvc\Entity\Entity->__set() in src/XF/AddOn/DataType/BbCodeMediaSite.php at line 81
  13. XF\AddOn\DataType\BbCodeMediaSite->importAddOnData() in src/XF/Job/AddOnData.php at line 108
  14. XF\Job\AddOnData->run() in src/XF/Job/Atomic.php at line 38
  15. XF\Job\Atomic->run() in src/XF/Job/Manager.php at line 241
  16. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
  17. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 138
  18. XF\Job\Manager->runUnique() in src/XF/Install/Controller/AbstractController.php at line 24
  19. XF\Install\Controller\AbstractController->manualJobRunner() in src/XF/Install/Controller/Upgrade.php at line 243
  20. XF\Install\Controller\Upgrade->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
  21. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  22. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  23. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1852
  24. XF\App->run() in src/XF.php at line 328
  25. XF::runApp() in install/index.php at line 14


Does anyone have the parameters required to add this table back? I'm not entirely sure what columns, character sizes, etc. are required.

Thanks!
 
The full MySQL query to create it is as follows:
SQL:
CREATE TABLE `xf_addon` (
  `addon_id` varbinary(50) NOT NULL,
  `title` varchar(75) NOT NULL,
  `version_string` varchar(30) NOT NULL DEFAULT '',
  `version_id` int(10) unsigned NOT NULL DEFAULT 0,
  `json_hash` varbinary(64) NOT NULL DEFAULT '',
  `active` tinyint(3) unsigned NOT NULL,
  `is_legacy` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `is_processing` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `last_pending_action` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`addon_id`),
  KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 
There is at least one record that needs to be in that table too:
Code:
INSERT INTO xf_addon
   (
      addon_id,
      title,
      version_string,
      version_id,
      json_hash,
      active
   )
VALUES
   ('XF', 'XenForo', '2.0.0 Alpha', 2000010, '', 1)
(The version string and ID should match what you have installed.)
 
The full MySQL query to create it is as follows:
SQL:
CREATE TABLE `xf_addon` (
  `addon_id` varbinary(50) NOT NULL,
  `title` varchar(75) NOT NULL,
  `version_string` varchar(30) NOT NULL DEFAULT '',
  `version_id` int(10) unsigned NOT NULL DEFAULT 0,
  `json_hash` varbinary(64) NOT NULL DEFAULT '',
  `active` tinyint(3) unsigned NOT NULL,
  `is_legacy` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `is_processing` tinyint(3) unsigned NOT NULL DEFAULT 0,
  `last_pending_action` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`addon_id`),
  KEY `title` (`title`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
There is at least one record that needs to be in that table too:
Code:
INSERT INTO xf_addon
   (
      addon_id,
      title,
      version_string,
      version_id,
      json_hash,
      active
   )
VALUES
   ('XF', 'XenForo', '2.0.0 Alpha', 2000010, '', 1)
(The version string and ID should match what you have installed.)
So I did both of these, and I get this:

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'addon_id' in 'field list' in src/XF/Db/AbstractStatement.php at line 212

  1. XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 174
  2. XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 35
  3. XF\Db\Mysqli\Statement->prepare() in src/XF/Db/Mysqli/Statement.php at line 46
  4. XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 69
  5. XF\Db\AbstractAdapter->query() in src/XF/Db/AbstractAdapter.php at line 145
  6. XF\Db\AbstractAdapter->insert() in src/XF/Mvc/Entity/Entity.php at line 1343
  7. XF\Mvc\Entity\Entity->_saveToSource() in src/XF/Mvc/Entity/Entity.php at line 1085
  8. XF\Mvc\Entity\Entity->save() in src/XF/AddOn/DataType/WidgetDefinition.php at line 74
  9. XF\AddOn\DataType\WidgetDefinition->importAddOnData() in src/XF/Job/AddOnData.php at line 108
  10. XF\Job\AddOnData->run() in src/XF/Job/Atomic.php at line 38
  11. XF\Job\Atomic->run() in src/XF/Job/Manager.php at line 241
  12. XF\Job\Manager->runJobInternal() in src/XF/Job/Manager.php at line 187
  13. XF\Job\Manager->runJobEntry() in src/XF/Job/Manager.php at line 138
  14. XF\Job\Manager->runUnique() in src/XF/Install/Controller/AbstractController.php at line 24
  15. XF\Install\Controller\AbstractController->manualJobRunner() in src/XF/Install/Controller/Upgrade.php at line 243
  16. XF\Install\Controller\Upgrade->actionRunJob() in src/XF/Mvc/Dispatcher.php at line 249
  17. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 88
  18. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 41
  19. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 1852
  20. XF\App->run() in src/XF.php at line 328
  21. XF::runApp() in install/index.php at line 14

Any idea? Using RC2. Used all statements as-is.
 
You're missing more than just the add-on table. It looks like columns have been dropped.

Unfortunately at this point, restoring from a backup is really the only recommendation we could give. The integrity of the database has been severely compromised.
 
You're missing more than just the add-on table. It looks like columns have been dropped.

Unfortunately at this point, restoring from a backup is really the only recommendation we could give. The integrity of the database has been severely compromised.
Is it feasible to just nuke this copy and start fresh? I really could not care less about most data besides users and posts, which I should be able to move over if required?
 
The only approach to do that would be to use the XF2 to XF2 importer. Each individual importer should certainly still be considered beta (and will be after XF2 itself goes stable), but hopefully that should still work, even with the missing tables/columns.
 
The only approach to do that would be to use the XF2 to XF2 importer. Each individual importer should certainly still be considered beta (and will be after XF2 itself goes stable), but hopefully that should still work, even with the missing tables/columns.
Did not even think of this, thank you for the idea. Will give it a try and report back.
 
Long story short, made the jump to 2.0. Made a backup of our old database, and then our backup drive decided to fail on us. So, now I'm stuck with a dead backup drive and a non-functional XF install.

With no backup, I'm forced to stick with what I have. I receive this error:




Does anyone have the parameters required to add this table back? I'm not entirely sure what columns, character sizes, etc. are required.

Thanks!
Were you able to do a full restore of your site with the old back up?
If the importer doesn't work give it a shot and see what add-ons you don't need and disable them.
 
Top Bottom