Fixed Upgrading from XenForo 1.5.5a to 2.3 doesn't work

JackieChun

Well-known member
Affected version
2.3
The following happens when upgrading 1.5.5a to 2.3.

InvalidArgumentException: Table 'xf_job' does not exist so cannot be altered in src/XF/Db/Schema/Alter.php at line 39

XF\Db\Schema\Alter->__construct() in src/XF/Db/SchemaManager.php at line 231
XF\Db\SchemaManager->newAlter() in src/XF/Db/SchemaManager.php at line 152
XF\Db\SchemaManager->alterTable() in src/XF/Install/Upgrader.php at line 82
XF\Install\Upgrader->syncJobStructure() in src/XF/Install/Controller/Upgrade.php at line 123
XF\Install\Controller\Upgrade->actionRun() in src/XF/Mvc/Dispatcher.php at line 362
XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 269
XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2777
XF\App->run() in src/XF.php at line 798
XF::runApp() in install/index.php at line 16

Upgrading the same forum to XenForo 2.2.5 does work correctly, so that's the intermediate solution I used. It's not ideal for most users, obviously.
 
To go from 1.5 to 2.3 can be very problematic. Now that your on 2.2.5? (2.2.16 PL2 is the latest version), here is a great guide on upgrading to XF 2.3 though it looks like you do not need it...

 
Still stuck on upgrading from 2.2 to 2.3. Only using the country flags add-on, which is compatible with 2.3. I guess I'll stick with 2.2 until all the upgrade issues are resolved.
 
Interesting to have found this thread and that it's recent, I'm encountering the exact same issue upgrading from 1.5.24 to the latest 2.3. What is the solution? Upgrading to a lower version? I tried this earlier but it told me there was a more recent update and to use that.
 
Interesting to have found this thread and that it's recent, I'm encountering the exact same issue upgrading from 1.5.24 to the latest 2.3. What is the solution? Upgrading to a lower version? I tried this earlier but it told me there was a more recent update and to use that.
You kind of need to report your own issue separately and post what issues (error messages, what actually is happening) you are having. Nobody can give you a solution without know what errors you are facing. Good to include your server config and PHP version too.
 
You kind of need to report your own issue separately and post what issues (error messages, what actually is happening) you are having. Nobody can give you a solution without know what errors you are facing. Good to include your server config and PHP version too.
I am having this exact issue verbatim. It is the exact same stack trace. There is no xf_job table in 1.5.24
 
I agree, I should have phrased that better.
To upgrade from 1.5 to 2.3 may take careful planning and multiple steps... ;)

Update:
Upgrading 1.5.24 to 2.2.5 and then 2.3.0 works. This does seem to be a bug in the most recent version however as it's not able to upgrade from Xenforo 1
Glad you successfully upgraded and developed an operation using multiple steps. :)
 
Last edited:
We'll get this sorted for the next release. In the meantime upgrading to 2.2 first should be fine, or you can replace \XF\Install\Upgrader::syncJobStructure with:

PHP:
public function syncJobStructure(): void
{
    $sm = $this->db()->getSchemaManager();

    if (!$sm->tableExists('xf_job'))
    {
        return;
    }

    $sm->alterTable('xf_job', function (Alter $table) use ($sm)
    {
        if (!$sm->columnExists('xf_job', 'attempts'))
        {
            $table->addColumn('attempts', 'tinyint', 3)->setDefault(0);
        }
        if (!$sm->columnExists('xf_job', 'priority'))
        {
            $table->addColumn('priority', 'smallint', 5)->setDefault(100);
            $table->addKey(['priority', 'trigger_date'], 'priority_execute_date');
        }
    });
}
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.3).

Change log:
Check if job table exists before attempting to sync structure
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom