XF 2.1 Error during upgrade: Unknown column 'likes' in 'xf_post'

Recep Baltaş

Well-known member
XF\Db\Exception: xf_post: MySQL query error [1054]: Unknown column 'likes' in 'xf_post' in src/XF/Db/AbstractStatement.php at line 217
XF\Db\AbstractStatement->getException() in src/XF/Db/Mysqli/Statement.php at line 196
XF\Db\Mysqli\Statement->getException() in src/XF/Db/Mysqli/Statement.php at line 77
XF\Db\Mysqli\Statement->execute() in src/XF/Db/AbstractAdapter.php at line 89
XF\Db\AbstractAdapter->query() in src/XF/Db/Schema/AbstractDdl.php at line 151
XF\Db\Schema\AbstractDdl->apply() in src/XF/Db/SchemaManager.php at line 149
XF\Db\SchemaManager->alterTable() in src/XF/Install/InstallHelperTrait.php at line 594
XF\Install\Upgrade\AbstractUpgrade->alterTable() in src/XF/Install/InstallHelperTrait.php at line 262
XF\Install\Upgrade\AbstractUpgrade->migrateTableToReactions() in src/XF/Install/Upgrade/2010010-210a.php at line 567
XF\Install\Upgrade\Version2010010->step34() in src/XF/Install/Controller/Upgrade.php at line 173
XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 321
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 248
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 100
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 50
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2177
XF\App->run() in src/XF.php at line 390
XF::runApp() in install/index.php at line 14

The process goes on now... Upgrading... 2.1.0 Alpha, Step 34


XenForo developer
Staff member
Did you attempt to reload this step while it may have still been running? If so, that could do this. Refreshing the upgrader is an option if you know the script has stopped and nothing is happening in the background (in MySQL), but it can potentially trigger errors like this.

If this step is taking a while, it likely indicates that you have a decent size forum and thus we probably would have recommended the command line upgrade (before the upgrade started). That generally eliminates timeout issues.


Well-known member
Just write it down...for future reference:

cd /path/to/www/folder
php cmd.php xf:upgrade

(Use screen so your upgrade will continue in case your SSH connection closes for whatever reason)

You can also use the cli for add-on upgrades but because the upgrades don't take that long it's more of a hassle (you have to know the internal add-on id too)


I had the same problem with "like_users" and +800k posts. (Step18 in 2010010-210a.php)
I fixed it, creating the column "like_users" from phpMyAdmin ;)

ALTER TABLE `xf_post` ADD `like_users` BLOB NOT NULL AFTER `embed_metadata`;

Regards ;)