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.

Importing from phpbb "ImportFile is required" error (NOW WITH ADDED SOLUTION!)

chonkchonk New
edited June 2014 in Vanilla 2.0 - 2.8

So I've tried to do this several times.
Followed the instructions.
The porter seems to create the correct import file.
When I try to upload I get the "ImportFile is required" error.
When I upload the file to Vanillas upload folder and try and import that way I get "The import file is not in the correct format"
The uploads folders permissions is set to chmod 755

Help.

Comments

  • Anyone? Bueller?

  • peregrineperegrine MVP
    edited June 2014

    perhaps if you mentioned the version of vanilla you are trying to import to. and the version of phpbb and the version of porter you are you using you would get some responses.

    so that's a minimum of 3 version numbers needed. as well as what you did, instead of I followed instructions.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • I installed vanilla version 2.1 and am trying to import a phpbb v.3.0.12 database over using porter v. 2.0.0

  • peregrineperegrine MVP
    edited June 2014

    check the ownership in the uploads folders. it must have the correct ownership.

    although it is frowned upon. you could temporarily change to 777 permissions, if your ownership is whacked.

    If your file is too large to upload directly to this page you can place it in your /uploads folder. Make sure the filename begins with the word export and ends with one of .txt, .gz.

    make sure the .txt or .gz is readable.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • peregrineperegrine MVP
    edited June 2014

    I've never used porter or exported or imported. so someone else may have better ideas. just a logical guess.

    you could also try to debug.

    and echo or decho values of $fpin and $Header.

    the $Header must be equal to "Vanilla" and readable.

    applications/dashboard/models/importmodel.php line 580

       public function GetImportHeader($fpin = NULL) {
                $Header = GetValue('Header', $this->Data);
                if($Header)
                    return $Header;
    
                if(is_null($fpin)) {
                    if(!$this->ImportPath || !file_exists($this->ImportPath))
                        return array();
                 ini_set('auto_detect_line_endings', TRUE);
                    $fpin = gzopen($this->ImportPath, 'rb');
                    $fpopened = TRUE;
                }
    
                $Header = fgets($fpin);
                if(!$Header || strlen($Header) < 7 || substr_compare('Vanilla', $Header, 0, 7) != 0) {
                    if(isset($fpopened))
                        fclose($fpin);
                    throw new Gdn_UserException(T('The import file is not in the correct format.'));
                }
                $Header = $this->ParseInfoLine($Header);
                if(isset($fpopened))
                    fclose($fpin);
              $this->Data['Header'] = $Header;
                return $Header;
            }
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • suPHP is installed on the server, so any php file that is chmod higher
    than 644 will throw an error, and any directory chmod higher than 755
    will throw an error. I don't have access to change this.

    The directory and file ARE writeable. Does it really have to be chmod 777?

  • $fpin = Resource id #144

  • idea import it in a localhost environment, create a mysqldump them import the dump to the database.

    grep is your friend.

  • LincLinc Admin

    @chonk Definitely use the latter option, placing it manually in the /uploads folder. Do not unzip the file that you get from Porter; put the .gz file in /uploads directly. Is it possible your server has zip disabled in its PHP install? That error indicates that Vanilla didn't find the word "Vanilla" at the start of the porter file, which means it opened it but it's garbled or wrong.

  • I just re-installed everything and get the same errors.

    Not sure if this sheds any light on anything but if I unzip my export file, the first 3 lines are:

    Vanilla Export: 2.0.0, Source: phpBB 3.*, HashMethod: phpBB

    // Export Started: 2014-06-09 15:57:07
    Table: User

  • Oh and yes, zip is enabled on my server

  • @Linc said:
    That error indicates that Vanilla didn't find the word "Vanilla" at the start of the porter file, which means it opened it but it's garbled or wrong.

    Hmmm. This might be the issue. I outputed $Header and it showed

    "���W��ʲ?��>ENJ���ܽ�J^����{�Lܐ d@�~*KH������sv�BI����Z(�e�ʏ������ES�_?�^�k��G�X�����-%0�Fhzz:��Q*��������F�ߴ�7-�@�O^�I�3E��w����ڵ����S��=*�o�ϳ�k���_����(�q�������aP�\ŏ�/D��Xv�U��"

    However when I unzip it locally and open in a text editor it looks fine.

    Is there a way to upload the unzipped file? Or can someone shed light on why the zip file is garbled?
    FWIW my server is running BZi2 v. 1.0.5

  • LincLinc Admin

    You can try the unzipped file but I seem to recall it not liking that. Foggy memory tho, worth a shot.

  • chonkchonk New
    edited June 2014

    Winner Winner Chicken Dinner!

    Here is my work around in case someone else has this same issue.

    So I unzipped the export file, uploaded it to the uploads folder

    THEN I renamed the text file with the .gz extension to fool the exporter into seeing the file. (THIS is the key)

    It then imported perfectly.

    Mark this as "solved"

  • LincLinc Admin

    Glad to hear. Looking at the code closer, I suspect it's failing on the gzopen command, which implies you don't have zlib.

  • I feel like chicken tonight, chicken tonight....

    grep is your friend.

  • UnderDogUnderDog MVP
    edited June 2014

    @Linc said:
    which implies you don't have zlib.

    Oh boy ... that needs a bug report to check for the prerequisites when we go for 2.3 final next week ...
    @chonk can you make a bug report on github?

    There was an error rendering this rich post.

  • @chonk: here's your bug report :-P

    @UnderDog: 2.3 final??

Sign In or Register to comment.