Skip to:
Content
Pages
Categories
Search
Top
Bottom

Vanilla 2 Converter


  • brokentwig
    Participant

    @brokentwig

    I’m working on adding a Vanilla Forums 2 converter to the bbPress Import package. Are there any developers out there that can answer a couple questions for me about how the converter engine works? I can reverse engineer it, but takes a lot more time than chatting with the guy/gal that wrote it. Thanks!

Viewing 17 replies - 26 through 42 (of 42 total)

  • brokentwig
    Participant

    @brokentwig

    Disreguard that, It’s in your revision.

    Introduce Forum Importer template for use with importing from Vanilla 2.0.18.1

    bbPress Core Trac Ticket: https://bbpress.trac.wordpress.org/ticket/2179

    Codex Docs: ​https://codex.bbpress.org/import-forums/vanilla/


    brokentwig
    Participant

    @brokentwig

    Nice.

    The docs are now up also,


    @brokentwig
    Key changes from your great work getting this started

    • Topic tags are now included
    • Once bbPress core converter is updated we can filter the users imported
    • Added Topic Closed Status
    • Inline docs consistent with other importers
    • Whitespace and code formatting improved
    • Uses parser.php to convert HTML & Smilies
    • Reply status not needed, defaults are built into converter.php
    • Reply Order removed, this is calculated during the import

    The to do list:

    • Remove the `callback_savepass` & `authenticate_pass` as you rightly point out they are not needed and Vanilla uses the same hash as WordPress for passwords so this is too easy.

    If you see any bugs with the converter `Vanilla.php` please post these to the trac ticket here.

    If there is anything else that needs doing before or after the import that I have not already listed in the codex docs if you could add/update these that would be great.

    https://codex.bbpress.org/import-forums/vanilla
    (Use the same bbpress.org username and password to login)


    brokentwig
    Participant

    @brokentwig

    Stephen,
    I’m not sure what you mean by “Once bbPress core converter is updated we can filter the users imported”. I believe we need to add the ‘from_expression’ => ‘WHERE User.Deleted = 0’ back into the first user section, but if your saying the core converter can do it, how does the core know who’s deleted?

    Also, is there a way we can check for the password type in the User table, and then if the type is not Vanilla, do something else? I didn’t dig into how you guys handle passwords you can’t convert, but I’m pretty sure a Facebook auth token will be one of those off cases. I would be happy to help test and work on this more to produce a finished product.

    Cool, I’ll add this back in `‘from_expression’ => ‘WHERE User.Deleted = 0′`.
    I removed it as if there is a `‘from_expression’` in the template it takes precedence and ignores any `‘join_’` expressions. So I need to dig around `converter.php` and find why it is ignoring the `’join_’` expressions when converting the users.

    The `callback_savepass` & `authenticate_pass` is where we add any extra password algorithms if needed for non WordPress passwords (phpBB.php importer is a good example)

    I deleted my Facebook account a couple of years ago so I won’t be doing any FB stuff 😉


    brokentwig
    Participant

    @brokentwig

    I’m not 100% confident “Banned” are Role 1, and “Confirm Email” are Role 3 on all Vanilla databases. Due to the complexity, I think it should be left out. I posted my SQL queries in your codex codes under the “Notes” section. Feel free to tweak my comments to your style.

    Maybe you can help me with the password checker. It looks like I can reference the entire record row using the callback methods in the converter code. I just don’t know what to do if the password type isn’t a Vanilla password. What is the proper action here, and is this code/syntax correct?

    ` public function callback_cleanpass( $password, $row) {
    if ($row[‘HashMethod’] == ‘Vanilla’) {
    return $password;
    } else {
    return ?????;
    }
    }`


    brokentwig
    Participant

    @brokentwig

    Actually, it just got a lot more complicated. It appears when I sign in via Facebook, Google, or some other method, a username is created in the User table, a password is saved as a Blob, the HashMethod is “Vanilla”, but another tables holds the authentication token and it’s source (Facebook, Twitter, etc). I’ll dig in deeper to find out if there’s some way to easily filter out 3rd party authenticators and then deal with thier password differently.


    brokentwig
    Participant

    @brokentwig

    Maybe it will work the way it is. Users who login via some other method still have thier username and email stored in the User table and are for all intents and purposes a “User”. Our converter will convert whatever is in the Password blob, but it won’t match thier 3rd party password (I tested it). These users will need to use the password reset in WP to fix this. I think either you can add this to your codex, or I can make a note at the bottom indicating some users will need to reset thier passwords, so maybe a mass email notifying users of the change will handle it. I don’t think there’s anything we can do with the converter to solve this.

    Thanks for adding that to the codex, I am not sure we should go that route though, I think we should not advise anyone to modify their existing forum directly with SQL. I think we are better off stating that all users including banned and deleted users are imported into WordPress and after importing you should manually delete these users through the WordPress Users admin panel.

    As to the correct code/syntax for the password, honestly I have no idea! Give me a code example and I can hack around and make stuff work but code from scratch I am at noob level 😉

    I started learning PHP when I started playing with bbPress not that long ago and along with WordPress they are my only PHP learning resources and a testament to @johnjamesjacoby coding with awesome inline docs.

    With all that said though I think it would probably be best if you want Facebook, Twitter, Google, Yahoo, OpenID etc etc logins for WordPress/bbPress it will be much easier to install one of the many WP plugins that offer this. Then have the end users link their existing user profile to Facebook, Twitter or whoever, otherwise there will be all sorts of values we are trying to migrate from Vanilla to support a vast array of different user plugin implementations that are available for WordPress.


    brokentwig
    Participant

    @brokentwig

    Yeah, I think your right. I think we should just leave the `from_expression’ => ‘WHERE User.Deleted = 0′` out completely. It would just orpan items anyway. I pulled my notes from the doc. With all that said, I’ll download the Vanilla.php you posted in the codex and give her a run on my test server. I think she’s done.


    brokentwig
    Participant

    @brokentwig

    The Vanilla.php you posted at https://bbpress.trac.wordpress.org/ticket/2179 worked fine. Thanks alot for the help getting this dialed in and submitting it for inclusion in the coore build. I’m sure there’s a few people out there itching to get off of Vanilla.


    Jack Tarantino
    Participant

    @jacopovip

    I seem to be having an issue with how the converter itself works? I run the converter and it tells me “No forums to convert” as well as no anything else. I copied the SQL in the title attribute and ran that in phpmyadmin and it returns a proper data set as expected. I experimented with entering incorrect values for the db information and that didn’t actually produce any errors or any difference at all. I’m thinking there’s some sort of problem connecting to the db and no error handling for that issue.. Any idea what could be going wrong? This is on WordPress latest and a fresh install of bbPress with just that Vanilla file added.


    brokentwig
    Participant

    @brokentwig

    Jack, try running it again, but this time after it fails with zero to convert, just hit start again. It did that to me yesterday. Make sure you check import users.


    brokentwig
    Participant

    @brokentwig

    You also might want to check purge last import.


    Jack Tarantino
    Participant

    @jacopovip

    Got it to work! Thanks a bunch guys!


    brokentwig
    Participant

    @brokentwig

    What did you do Jack?

Viewing 17 replies - 26 through 42 (of 42 total)
  • You must be logged in to reply to this topic.
Skip to toolbar