XF 1.5 Upgrade from 1.5 to 2.2 on a local server

Nicolas FR

Well-known member
Hello,

For my personal culture I would like to upgrade from an XF 1.5 forum to XF 2.2.
I will install XF 1.5 locally. But what I would like is to upgrade via CLI. Is it possible to do this on demand or is it only the number of messages (1m I believe) that triggers the CLI upgrade?
If so how could I artificially increase the number of messages so far? (no, I'm not going to write them myself!!)

Thanks !
 
Solution
You can use CLI to upgrade if you wish - it isn't limited to larger sites.

Code:
cd /path/to/xf/root

php cmd.php xf:upgrade --verbose
I have a XF2 database from my old forum can i import it on a XF1 blank database ?
Losing some infos will not be important, it's just for test purpose.

I will try in any case but if someone had already tried...
 
Trying to install XF1.5, receive this error
Code:
Fatal error:
    Array and string offset access syntax with curly braces is no longer supported in C:\laragon\www\old_xenforo\library\Lgpl\utf8.php on line 47

Fatal error:
    Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, XenForo_Application given in C:\laragon\www\old_xenforo\library\Zend\Registry.php:206

Stack trace:
    #0 C:\laragon\www\old_xenforo\library\XenForo\Application.php(1005): Zend_Registry->offsetExists('db')
    #1 C:\laragon\www\old_xenforo\library\XenForo\Application.php(1638): XenForo_Application::get('db')
    #2 C:\laragon\www\old_xenforo\library\XenForo\Error.php(160): XenForo_Application::getDb()
    #3 C:\laragon\www\old_xenforo\library\XenForo\Application.php(403): XenForo_Error::logException(Object(ErrorException))
    #4 [internal function]: XenForo_Application::handleFatalError() #5 {main} thrown in C:\laragon\www\old_xenforo\library\Zend\Registry.php on line 206
 
Ok i'm on PHP 7.4 now and receive this error
Code:
Fatal error:
    Uncaught ErrorException: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in C:\laragon\www\old_xenforo\library\Zend\Registry.php:206
    
Stack trace:
    #0 C:\laragon\www\old_xenforo\library\Zend\Registry.php(206): XenForo_Application::handlePhpError(8192, 'array_key_exist...', 'C:\\laragon\\www\\...', 206, Array)
    #1 C:\laragon\www\old_xenforo\library\Zend\Registry.php(183): Zend_Registry->offsetExists('config')
    #2 C:\laragon\www\old_xenforo\library\XenForo\Helper\File.php(284): Zend_Registry::isRegistered('config')
    #3 C:\laragon\www\old_xenforo\library\XenForo\Error.php(78): XenForo_Helper_File::getInternalDataPath()
    #4 C:\laragon\www\old_xenforo\library\XenForo\Application.php(381): XenForo_Error::unexpectedException(Object(ErrorException))
    #5 [internal function]: XenForo_Application::handleException(Object(ErrorException))
    #6 {main} thrown in C:\laragon\www\old_xenforo\library\Zend\Registry.php on line 206
 
Error received even with PHP 7.4 do i need to downgrade to PHP 7.3 ?
Ok i'm on PHP 7.4 now and receive this error
Code:
Fatal error:
    Uncaught ErrorException: array_key_exists(): Using array_key_exists() on objects is deprecated. Use isset() or property_exists() instead in C:\laragon\www\old_xenforo\library\Zend\Registry.php:206
   
Stack trace:
    #0 C:\laragon\www\old_xenforo\library\Zend\Registry.php(206): XenForo_Application::handlePhpError(8192, 'array_key_exist...', 'C:\\laragon\\www\\...', 206, Array)
    #1 C:\laragon\www\old_xenforo\library\Zend\Registry.php(183): Zend_Registry->offsetExists('config')
    #2 C:\laragon\www\old_xenforo\library\XenForo\Helper\File.php(284): Zend_Registry::isRegistered('config')
    #3 C:\laragon\www\old_xenforo\library\XenForo\Error.php(78): XenForo_Helper_File::getInternalDataPath()
    #4 C:\laragon\www\old_xenforo\library\XenForo\Application.php(381): XenForo_Error::unexpectedException(Object(ErrorException))
    #5 [internal function]: XenForo_Application::handleException(Object(ErrorException))
    #6 {main} thrown in C:\laragon\www\old_xenforo\library\Zend\Registry.php on line 206
 
You can use CLI to upgrade if you wish - it isn't limited to larger sites.

Code:
cd /path/to/xf/root

php cmd.php xf:upgrade --verbose
Tried but...
Capture d’écran 2022-10-22 093249.webp

There is no cmd.php file in the root folder. I activated debug and dev modes in the config.php file.
Same syntax as XF2 right ?
Code:
<?php

$config['db']['host'] = 'localhost';
$config['db']['port'] = '3306';
$config['db']['username'] = 'root';
$config['db']['password'] = '';
$config['db']['dbname'] = 'old_xf';

$config['superAdmins'] = '1';
$config['debug']['enabled'] = true;
$config['development']['enabled'] = true;
 
I should have uploaded the XF 2 files first! :rolleyes:
Then everything went well, I went from 1.5 to 2.2 in a few seconds (obviously with an empty database...)

Capture d’écran 2022-10-22 101101.webp
 
Last edited:
One last question : the upgrade went well but as I said the database was empty or almost. On a real migration with thousands of users and millions of messages would the procedure stop there too or would you have to use XF Importers?

Thanks.
 
Top Bottom