Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

[Solved] Error when importing

iTech278iTech278 New
edited August 2012 in Vanilla 2.0 - 2.8

Hello!

I am trying to convert my phpBB board to Vanilla. I have used the porter add-on to get the data file, however I get an error when trying to import the file to Vanilla. The error is as follows:

Failed to move uploaded file to target destination (C:\wamp\www/uploads/C:/wamp/www/uploads/import/735W4TTNQ1U6.txt). The error occurred on or near: C:\wamp\www\library\core\class.upload.php 212: if (!file_exists(dirname($Target))) 213: mkdir(dirname($Target)); 214: 215: if (!move_uploaded_file($Source, $Target)) 216: throw new Exception(sprintf(T('Failed to move uploaded file to target destination (%s).'), $Target)); 217: } 218: return $Parsed; 219: } 220: Backtrace: [C:\wamp\www\applications\dashboard\controllers\class.importcontroller.php:167] Gdn_Upload->SaveAs(); [C:\wamp\www\applications\dashboard\controllers\class.importcontroller.php:167] ImportController->Index(); [C:\wamp\www\library\core\class.dispatcher.php:322] PHP::call_user_func_array(); [C:\wamp\www\index.php:53] Gdn_Dispatcher->Dispatch();

Thanks!

Comments

  • Step 1 :

    class.importmodel.php lines 977-985:

      $Sql = "load data infile $Path into table $Tablename
         character set utf8
         columns terminated by ','
         optionally enclosed by '\"'
         escaped by '\\\\'
         lines terminated by '\\n'
         ignore 1 lines";
      $this->Query($Sql);
    


    Workaround :

    Changing lines terminated by '\n' to lines terminated by '\r\n' solved the problem for me.

    You might run into 1 or 2 other problems, but let's deal with them 1 by 1.

    There is also the Porter Plus plugin by x00 :

    Porter Plus

    It deals with a couple of phpBB specific issues.

    There was an error rendering this rich post.

  • iTech278iTech278 New
    edited August 2012

    Thanks for your response @UnderDog. After making the change to the line, I am not able to access the import page from the dashboard. I get Error 101: Connection Reset when clicking "Import" in the Dashboard. Should I try undoing that change and exporting with PorterPlus?

    EDIT: I tried undoing the change and exporting with PorterPlus + phpBB fixes, but I get the same error as in the original post.

  • You have to apply my change and then try to import again (export with Porter Plus).

    I remember now, that step for the change is 1 step further AFTER the upload succeeded.

    I think I manually placed that import file there (/uploads/import/), but not sure though.


    See if you have this code in your /applications/dashboard/controllers/class.importcontroller.php line 167

    $ImportPath = $Upload->GenerateTargetName(PATH_ROOT . DS . 'uploads' . DS . 'import', $Extension);
                   $Upload->SaveAs($TmpFile, $ImportPath);
                   $Imp->ImportPath = $ImportPath;
                   $this->Form->SetFormValue('PathSelect', $ImportPath);

    There was an error rendering this rich post.

  • iTech278iTech278 New
    edited August 2012

    I can't try to import after the '\r\n' change due to the aforementioned Error 101. Here are lines 166-170 in that file (170 is a blank line, so it doesn't show):

    $ImportPath = $Upload->GenerateTargetName(PATH_ROOT . DS . 'uploads' . DS . 'import', $Extension); $Upload->SaveAs($TmpFile, $ImportPath); $Imp->ImportPath = $ImportPath; $this->Form->SetFormValue('PathSelect', $ImportPath);

  • @UnderDog Also, what do you mean by the following?

    UnderDog said:
    I think I manually placed that import file there (/uploads/import/), but not sure though.

  • I meant that I copied the file that ended with .tar.gz (the result of Porter Plus) and pasted it in /uploads/import, so I tried to avoid that 'move_uploaded_file' function.

    Give it a try

    There was an error rendering this rich post.

  • @UnderDog Hmm...still no luck. I got the same error even using Porter Plus with phpBB fixes and moving it to C:\wamp\www/uploads/import/ (and importing it from that location as well). It looks like it is still trying to copy it to a new file with a randomly-generated file name...

  • Ok, so after you've placed the .tar.gz file in the /uploads/import go back to import in your admin panel. It will say that it sees an already started import, but you can choose to start over

    So if you start over, make a screenshot, cut out everything non-important, I want to see which options you have on your screen. (paste the screenshot :-) )

    There was an error rendering this rich post.

  • @UnderDog Hmm...PorterPlus is giving me a .txt file with the name "export_phpbb_2012-08-07_162736". I placed this file in the import folder, but still don't see anything different on the import screen (attached). Does it have to be .tar.gz to be recognized? If so, how would I get it to export as a .tar.gz file? Thanks for your help!

  • Ok, lots of solutions ready to try next. This is the first try:

    class.upload.php

    Patch: (around) Line 211 - 216: $Target = PATH_LOCAL_UPLOADS.'/'.$Parsed['Name'];
    Modified: $Target = $Parsed['Name'];
    

    There was an error rendering this rich post.

  • @UnderDog Thanks so much! That worked! Now I can use my Vanilla Forum!

Sign In or Register to comment.