Skip to:
Content
Pages
Categories
Search
Top
Bottom

Import SMF to bbPress


  • stitzelj
    Participant

    @stitzelj

    Has anyone drafted a script that will import a Simple Machines Forum into bbPress? And if not, anyone savvy enough with enough free time on their hands to put one together?

Viewing 22 replies - 1 through 22 (of 22 total)
  • There is nothing written or in the works that I know of, but if you can get into phpBB format, there is an importer:

    http://bbpress.org/forums/search.php?q=import

    Trent


    lonemadmax
    Member

    @lonemadmax

    Sometime ago I adapted a script that imports data from phpBB. Some of the changes are probably a Bad Thing, but it worked for me (about 40 users, 15 forums, 150 topics and 800 posts).

    Among the changes:

    • Keeps current users, forums, etc. in bbPress. The new forum had started, so I wanted that, even though most new messages were just for testing.
    • When an SMF username is found in the bbPress DB, the bbPress user is assigned to the SMF one. Otherwise, a new user is created.
    • Imports tags that can’t be used in bbPress, such as table, flash and some stupid formatting stuff.
    • Probably other things I don’t remember.

    Jump to the CONFIGURATION SECTION and change to match your setup and liking. Wherever you see phpbb it really means smf, of course. One of the things I didn’t do was that type of cleanup. Also, despite the comments saying that you need a fresh new install of bbPress, that’s not true anymore.

    Keep in mind that data reuse only happens with users. If a forum or a topic exists in bbPress with the same name that one from SMF, you’ll probably get two topics with the same name (different ID number, though). I haven’t tested this, and I don’t know if that means problems.

    Also, subforums become forums on their own, as bbPress uses a flat one-level system. If you are using the plugin that allows for subforums, you may be able to correct this afterwards, or even add the code to the script so that it is done.

    If you don’t want any of the probably Bad Things I introduced, get the original one and look compare the

    $export_sql

    lines to have a feeling of what to change.

    Now, if there’s any interest, where do I send it?

    >>Now, if there’s any interest, where do I send it?

    Certainly.


    lonemadmax
    Member

    @lonemadmax

    OK, if you are lucky and the server isn’t dead as it usually is, you may get it here.

    Remember, no guarantees. I hadn’t even read php before messing with that script.

    Script works, but i have problem. All not english (russian) symbols convert in questions (???????).

    Example:

    Before – “Эволюция Красоты (YouTube)”

    After – “??????? ??????? (YouTube)”

    My smf forum 1.1.2 and all database in UTF-8. Its strange why script dont understand russian characters. Anyway thanks.


    lonemadmax
    Member

    @lonemadmax

    I’m very sorry. My SMF forum was not in UTF-8. If your try was in a test bbPress forum, try again deleting all utf8_encode calls in the script (leave the argument, of course).

    It does not help. Maybe it is a bug of bbpress 0.81 or this script. Or mine.


    lonemadmax
    Member

    @lonemadmax

    I’m very sorry to hear that. The problem is most probably in the script; as I said, I’m a complete newbie to php and databases, and just modified the script without really knowing how much of it worked. The only thing I can say is: have you deleted all occurrences of ut8_encode? There are more than one. Also utf8_decode may give you problems, but I don’t think they’d be the ones your seeing.

    Is there any chance that I could get a dump of your database? (A fake one, with russian characters in fake posts and fake users from SMF in the same conditions as the real one, so that I can play with it here.) If so, please send it to antiswen at yahoo dot es (yep, es, not com). Oh, and please zip it or something so that yahoo doesn’t mess with the text.

    >>The only thing I can say is: have you deleted all occurrences of ut8_encode? There are more than one.

    I deleted all ut8_encode. You can see my script.

    >>If so, please send it to antiswen at yahoo dot es (yep, es, not com).

    I don`t know spanish (yahoo dot es?), that is why i put it on my blog.

    Download my script and SMF db


    lonemadmax
    Member

    @lonemadmax

    You don’t have to know Spanish to send mail :-)

    I got your script, and it worked for me. That is, after I added an ‘l’ you deleted with a parenthesis :-). So it seems the problem with your second try was just a typo. In line 521 the original script said:

    $import_sql = utf8_encode($import_sql);

    and yours say:

    $import_sql = $import_sq;

    So add back the ‘l’ or delete the whole line, as it’s useless in the utf8->utf8 version.

    Thank you very match!


    Stretsh
    Member

    @stretsh

    This code is written for PHP5. It works perfectly.

    PHP4 users will need an extra piece of code, however, because the function file_put_contents does not come with PHP4.

    So copy this piece of code and paste it on the bottom of the php file, but before the ?> tag

    if (!function_exists('file_put_contents')) {
    function file_put_contents($file, $contents = '', $method = 'a+') {
    $file_handle = fopen($file, $method);
    fwrite($file_handle, $contents);
    fclose($file_handle);
    return true;
    }
    }


    lonemadmax
    Member

    @lonemadmax

    Thank you, I’ll do that when I clean the script from the references to phpbb and other stuff one day. This one bit me, as I have PHP4, but the script can still be used to import the data directly and not put it in a file.


    Stretsh
    Member

    @stretsh

    Did anyone report strange things happening after the import with this script? Like anonymous visitors not being able to view new posts.


    lonemadmax
    Member

    @lonemadmax

    From what I see in topic 856, it seems I’m late again. Does your last message mean that everything’s OK now? I still don’t understand how the cache of 3 different browsers conspired against us, so maybe there’s a problem with the script. Maybe a recount is needed after use. Or it does something wrong to the database under some circumstances, I don’t know. I can say that I didn’t have your problem, but I’ve only tested with bbPress 0.74 and 0.80, and barely enough to have a feeling that it worked (posting after the import is one of the few things I tried). And all feedback I’ve had has come from this topic, so if it is something in the script, you were the first to notice.

    I am a bit confused. Can you use the script here: http://www.iteisa.com/phpbb2bbpress/

    And just change all the instances of phpbb to smf?

    I am still trying to convert my SMF to bbPress. I have thousands of messages I’d hate to lose.

    Thanks!

    I don’t know. Is the phpbb structure identical to the smf structure?

    Maybe you want to use an SMF -> phpBB converter, and then convert from phpBB -> bbPress.

    Well I got it converted to phpBB. Then when I did the phpBB-> bbPress convert it got held up. I guess I’ll just wait until bbPress comes with an included importer.

    Thanks!

    I was able to import it perfectly, except now I cant log in with any of the usernames and after I had the new password generated, the admin account from SMF doesn’t have admin privileges on the bbpress board.

    any progress on importing phpbb3??

    hy folks,

    so there are new way to import smf forum in a bbpress forum?


    kevinjohngallagher
    Member

    @kevinjohngallagher

    Wow man, a 2 year old post…

    I’d try here: http://bbpress.org/forums/tags/smf

    3rd one down looks like a winner:

    http://bbpress.org/forums/topic/successfully-convert-smf-20-rc1-to-bbpress-10

    99/100 the best way is to convert from any forum to phpBB3 and from there to bbPress.

    Good Luck

Viewing 22 replies - 1 through 22 (of 22 total)

You must be logged in to reply to this topic.