Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Importing from SMF - Stuck with no error

I am attempting to migrate from SMF (manually ported from forums.net database export) and the import gets stuck at the "Discussions" section of load tables. there is a red bar at the top but no error in it.

The version of SMF I'm porting from is SMF 2.0.15 and the version of Vanilla I am porting to is 2.5

Has anyone experienced this? Anything I should be looking for to fix the issue? I'm trying to attempt a dry run to migrate my organizations forum to Vanilla.

Comments

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @CHIJon

    Welcome to the community.

    It might be that it is timing out.

    Can you check your server logs?

    R_J
  • @whu606 - I don't know if it is that. I'm not seeing anything in logs. It throws up that red error rather quickly. After doing a bit of digging I found a setting I could enable for debugging by setting $Configuration['Debug'] = TRUE; in conf/config.php

    Enabling that results in the following being displayed in the red block:

    ## /var/www/html/vanilla/applications/dashboard/models/class.importmodel.php(1297)
    #0 /var/www/html/vanilla/applications/dashboard/models/class.importmodel.php(1232): ImportModel->_LoadTableLocalInfile('Discussion', '/var/www/html/v...')
    #1 /var/www/html/vanilla/applications/dashboard/models/class.importmodel.php(1195): ImportModel->loadTable('Discussion', '/var/www/html/v...')
    #2 [internal function]: ImportModel->loadTables()
    #3 /var/www/html/vanilla/applications/dashboard/models/class.importmodel.php(1601): call_user_func(Array)
    #4 /var/www/html/vanilla/applications/dashboard/controllers/class.importcontroller.php(56): ImportModel->runStep(6)
    #5 [internal function]: ImportController->go('NrkqENNtjI6wB8G...')
    #6 /var/www/html/vanilla/library/core/class.dispatcher.php(832): call_user_func_array(Array, Array)
    #7 /var/www/html/vanilla/library/core/class.dispatcher.php(261): Gdn_Dispatcher->dispatchController(Object(Gdn_Request), Array)
    #8 /var/www/html/vanilla/index.php(29): Gdn_Dispatcher->dispatch()
    #9 {main}
    
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    What version of PHP are you running?

    Porter doesn't currently work with 7.0

    See this discussion if that is the issue: https://open.vanillaforums.com/discussion/33808/vanilla-porter-and-php-7-1

    Caylus
  • CaylusCaylus ✭✭

    This is the full function that's throwing the error then

        protected function _LoadTableLocalInfile($tablename, $path) {
            if (extension_loaded('mysqli') === false) {
                throw new Exception('mysqli extension required for load data');
            }
    
            $tablename = Gdn::database()->DatabasePrefix.self::TABLE_PREFIX.$tablename;
            $path = Gdn::database()->connection()->quote($path);
    
            Gdn::database()->query("truncate table $tablename;");
    
            $sql = "load data local infile $path into table $tablename
             character set utf8mb4
             columns terminated by ','
             optionally enclosed by '\"'
             escaped by '\\\\'
             lines terminated by '\\n'
             ignore 1 lines";
    
            // We've got to use the mysqli_* functions because PDO doesn't support load data local infile well.
            $mysqli = new mysqli(c('Database.Host'), c('Database.User'), c('Database.Password'), c('Database.Name'), 128);
            $result = $mysqli->query($sql);
            if ($result === false) {
                $ex = new Exception($mysqli->error);
                $mysqli->close();
                throw new $ex;
            }
            $mysqli->close();
        }
    

    Which version of MySQL are you using?

    R_J
  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    If it is the mysqli library, it's either the PHP version being 7.something or a missing mysqli extension for PHP 5.something

    Caylus
  • CaylusCaylus ✭✭

    @R_J said:
    If it is the mysqli library, it's either the PHP version being 7.something or a missing mysqli extension for PHP 5.something

    I think the Myqli library is present, it's the SQL statement failing I think. Line 25 is the one throwing the error. I think the "load data local infile" might only be introduced in MySQL 5.7 or something, but not too sure.

  • Ah! I saw "requires PHP 5.3 or higher" and assumed that included 7. I'll review the link provided.

    I'm running 7.0.25

  • I disabled PHP7x and enabled 5.6 - receiving the same error. mysqli is present

  • RiverRiver MVP
    edited March 5

    @CHIJon said:
    I disabled PHP7x and enabled 5.6 - receiving the same error. mysqli is present

    If nothing else works, for an experiment. try downloading vanilla 2.1 and try to import into vanilla 2.1 and see if you get errors. then upgrade to 2.5 if you can successfully import.

    and /or porter.

    Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.

    Caylus
  • @river - thanks - I'll try that.

  • x00x00 MVP
    edited March 6

    The porter currently run on legacy php. This is not the case with he framework.

    Also suggest setting up the envirment for the porter localhost rather on a production server. There is no reason they have to be on the same environment, you could even use an a virtual machine.

    grep is your friend.

  • @x00 - I'm doing all of this in a VM on my local machine. Our live forum is currently hosted on forums.net - I'm doing some test runs to migrate from Forums.net >> SMF 2.x >> Vanilla

    Hopefully I'll have some time to install vanilla 2.1 (I may run a new VM for this and start with a baseline of Ubuntu 14x and PHP 5.3 instead of what I'm currently running) - thank you all for your help. Hopefully my next post will be shouting HOORAY.

    Caylus
Sign In or Register to comment.