1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Migrating md5 passwords to xenForo

Discussion in 'Installation, Upgrade, and Import Support' started by Hardcore, Feb 20, 2012.

  1. Hardcore

    Hardcore Active Member

    Quick question: We'd like to move over an old custom user database that's using md5 over to xenForo. Any tips would be appreciated.

  2. Brogan

    Brogan XenForo Moderator Staff Member

    Which software is it?

    You will need an importer to correctly import all of the users, forums, threads, post, etc.
    Currently there are only official importers for vB, IPB and phpBB so you will need to convert to one of those first.

    Your other option is to have a custom importer developed.
  3. Hardcore

    Hardcore Active Member

    It's all custom code created by me ages ago. We're only interested in moving over our user database at this time; not forums/threads/posts, etc. We'll be starting all of that from scratch.

    I'll be creating the custom script, so I just need to know if xenForo can deal with the old md5 generator passwords and if it'll convert them to its format upon login ... of if there's something else required to make this happen.


    (PS - xenForo is damn impressive. We can't wait to unleash it on our community.)
  4. guiltar

    guiltar Well-Known Member

    You need to write importer for it.
    vBulletin auth class has md5(md5(pass),salt) encoding and you may associate your md5 users with vB external auth after convertion of their hashes to md5(hash,salt).
    Thats how I did it. And no need any extra authentications. Import and forgot.
        protected function _importUser(array $user, array $options)
    $salt XenForo_Application::generateRandomString(30);
    $hash md5($user['user_password'] . $salt);
    $import = array(
    'username' => $user['user_login'],
    'email' => $user['user_mail'],
    'user_group_id' => 2,
    'authentication' => array(
    'scheme_class' => 'XenForo_Authentication_vBulletin',
    'data' => array(
    'hash' => $hash,
    'salt' => $salt
    'homepage' => $user['user_profile_site'],
    'register_date' => $user['user_date_register'],
    Jake Bunce likes this.
  5. Hardcore

    Hardcore Active Member

    Thanks. I'm new to this, so bare with me.
    1. Can you explain the "data" field in the xf_user_authenticate table? What's require for that?
    2. Will "scheme_class" update post import once the user signs in for the first time?
    Much appreciated!
  6. Hardcore

    Hardcore Active Member

    Also ... I'd be willing to pay (even in beer) a developer to write a quick php script to convert our user table to XF. ;-)

    It's a single table with no other dependencies.

    Let me know. We're eager!
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    My thoughts exactly.

    That data field is where the password information is stored. It is serialized data. Here is an example of the serial string for a vB password:

    The hash is md5(md5($password) . $salt). The salt is a 3 digit random string. So you need to generate a random salt for each user and then calculate the hash using that formula. Then serialize the information.

    The scheme_class in your case would be XenForo_Authentication_vBulletin. It will change to the default hashing scheme (XenForo_Authentication_Core) the next time the user changes their password.
  8. Hardcore

    Hardcore Active Member

    Thanks for all of the help. The XF support team was very helpful too.

    Importing a few hundred thousand users tonight. Wish us luck!
    pjfry, TheVisitors and Mike like this.
  9. middlewingnut

    middlewingnut Member

    Is the above explanation for an older version of the encoding? I need to do a similar thing, but my data field looks like:

    I have inherited a forum that gives me a (amongst other stuff) a list of user info with plain text password - bizarrely.

    Does th info in my post above have 2 different encodings of the password?
  10. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yours is different. The data you posted looks like it is for XenForo_Authentication_Core. We were talking about XenForo_Authentication_vBulletin.

    If you have plain text passwords then you can use any auth scheme. I recommend XenForo_Authentication_Core since it is more secure. You need to generate appropriate salts and hashes using the plain text passwords.
  11. middlewingnut

    middlewingnut Member

    Thanks again Jake,

    Will I find the details for that in the import area?
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    No. This is a development problem. You need a programmer. Documentation is available by looking at the existing code.
  13. Eric Russell

    Eric Russell Active Member

    Hi! Is it possible to get joomla passwords to work after a conversion?
  14. Digital Doctor

    Digital Doctor Well-Known Member

    Yes if vBulletin IMPEX has a Joomla importer that works.
    I'm sure Jake could do it if you paypal'd him a nice christmas present.
    Jake did my complex migration from an old school SQL forum where the vBulletin IMPEX wasn't working.
  15. Eric Russell

    Eric Russell Active Member

    I can get from joomla to xenforo via joomla-smf-vbulletin-xenforo. Impex doesn't work for joomla 2.5 just 1.5.
  16. Digital Doctor

    Digital Doctor Well-Known Member

    It might work. Hard to say.

    What about IPB ? J! => IPB ?

    Time is money.
    I don't know Jake's going rates ( I paid good money because he's the best: @php @life ).
    Get SchmitzIT to do it.
    He'll figure a way. Great guy. Super fair prices.
  17. Eric Russell

    Eric Russell Active Member

    I spoke to SchmitzIT and he didn't think it was possible to get passwords to work.

    I know, in the past, smf had a script which would allow joomla passwords to work, after a successful login smf would hash them in their own way and store them in the db. I'm wondering if something like this is possible to do in xenforo?
  18. Digital Doctor

    Digital Doctor Well-Known Member

    What about downgrading Joomla and trying vB impex.
  19. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Joomla is a CMS. What exactly do you need imported? Articles? Users? Anything else?

    What format does Joomla use for passwords? MD5? SHA1?
  20. Eric Russell

    Eric Russell Active Member

    Joomla using kunena forum. Basically just the forum along with users and working passwords.

Share This Page