Announcement

Collapse
No announcement yet.

Converting from IPB2

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Converting from IPB2

    Hey guys,

    I want to know if theres a converter that transfers all data (members, topics, posts etc) from Invision Power Board v2.0.X to vBulletin.

    Now I wanna make sure this can be done before I purchase vBulletin. I don't really wanna buy it and the conversion doesn't work.

    I seen another site do this but they had IPB 1.3.1 and all their data didn't transfer. They could only get the members to transfer.

    Can anyone help? Thanks a bunch

  • #2
    Here ya go. The details on the IPB2 to vB3 Importer.

    IPB (2)
    ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
    Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

    Comment


    • #3
      It doesn't convert members passwords!?

      Comment


      • #4
        Unfortunately it can't Grrr. Invision Board uses a completely different hashing.

        I believe Invision Board does:

        PHP Code:
        (md5($password) . $md5($salt)) 
        whereas vBulletin does

        PHP Code:
        md5(md5($password) . $salt
        So a IPB Hash doesn't mean it is gonna be the same as a vB3 Hash.

        So if a user typed in abc123 on IPB as their password, its equalvent would probably be like 2495yy89afbhsadifub or something
        Last edited by ManagerJosh; Sun 3 Jul '05, 2:37pm.
        ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
        Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

        Comment


        • #5
          Here's something you might be able to try....

          If IPB lets you add a custom profile field, create one and have your users enter a password there. If those get transfered over, maybe you can have the passwords re-hashed and transfered back into the member password column.
          Plan, Do, Check, Act!

          Comment


          • #6
            The following ipb function generates a random 5 character salt when that user registers their account for the first time. Note that random time is used.
            Code:
            function generate_password_salt($len=5)
            {
            	$salt = '';
            	srand( (double)microtime() * 1000000 );
            	for ( $i = 0; $i < $len; $i++ )
            	{
              $num   = rand(33, 126);
              if ( $num == '92' )
              	$num = 93;  
              $salt .= chr( $num );
            	}
            	return $salt;
            }

            now lets say that our randomly generated salt is '12345' (ok im being boring)
            And that our password we use to login is 'qwerty'

            take a look at the ibf_members_converge table it contains two important values
            converge_pass_salt: contains the value '12345'
            converge_pass_hash: contains md5( md5('12345').md5('qwerty') )

            so this is what happens during authentication

            Code:
            if ( $this->member['converge_pass_hash'] == $this->generate_compiled_passhash( $this->member['converge_pass_salt'], $md5_once_password ) )
            	return TRUE; //all good :)
            $this->member[] is just a private array of the class_converge which contains some of these values I mentioned
            Take a look at class_converge.php it is where most of the action is at

            Comment


            • #7
              IPB double md5 hashes? I thought it only did a single md5 hash for the password and everything, like how I did it...
              ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
              Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

              Comment


              • #8
                If you change the db and take the old hash and salt in.

                You just use the IPB password check, if it matches then you just update the password entered to the new vBulletin password and set a new salt.
                Scott MacVicar

                My Blog | Twitter

                Comment


                • #9
                  Let me warn you guys STRAIT UP. I am not a code hacker. I just know code, so this is not pretty, not gui, and not fancy. But if you want this stuff to work with your old iPB usernames and passwords, this is what you can use.

                  **** NOTICE ****
                  BACK UP ALL OF YOUR DATABASES BEFORE DOING THIS PROCEDURE.




                  **** NOTICE ****
                  NO REALLY... GO BACK YOUR STUFF UP. IM NOT KIDDING.



                  Okay, I dont know if you guys are still looking for this, but I got a hack working.

                  Heres all you have to do. Open up includes/functions_login.php. At or about line 142, you should see something like this:

                  Code:
                   
                  				if (
                  						$bbuserinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $bbuserinfo['salt']), '') AND
                  						$bbuserinfo['password'] != md5($md5password . $bbuserinfo['salt']) AND
                  						$bbuserinfo['password'] != iif($md5password_utf, md5($md5password_utf . $bbuserinfo['salt']), '') 
                  				)
                  Change that to:

                  Code:
                   
                  				if (
                  						$bbuserinfo['password'] != iif($password AND !$md5password, md5(md5($password) . $bbuserinfo['salt']), '') AND
                  						$bbuserinfo['password'] != md5($md5password . $bbuserinfo['salt']) AND
                  						$bbuserinfo['password'] != iif($md5password_utf, md5($md5password_utf . $bbuserinfo['salt']), '') AND
                  						$bbuserinfo['password'] != md5( md5( $bbuserinfo['salt'] ) . $md5password )
                  				)
                  What we just did was add in a authentication like how ipb does it. Next you need to open up phpMyAdmin or something, and change the structure of the table user, change salt from char(3) to char(5). This will support the 5 character salt which we are about to import from the ipb database.

                  Okay, here is where it gets ugly. Your going to need to modify this script in a few places. lets see if I documented it alright.

                  Code:
                   
                  <?php
                   
                  ##
                  ## Fill in the blanks for your two databases.
                  ##
                  $ipbdbusername = "";
                  $ipbdbpassword = "";
                  $ipbdatabase = "";
                  $vb3username = "";
                  $vb3password = "";
                  $vb3database = "";
                  ##
                  ## NOTICE: My tables in my ibf database were called ibf_<something> If yours 
                  ##	 were not called that, MAKE SURE YOU DO A SEARCH AND REPLACE FOR ibf_
                  ##
                  $ipbdb;
                  		$ipbdb = mysql_connect("localhost","$ipbdbusername","$ipbdbpassword");
                  		if (!ipbdb)
                  				die("Couldn't connect to Database");
                  		mysql_select_db('$ipbdatabase')
                  				or die("couldn't connectsss to nix_tusclan");
                   
                  $vb3db;
                  		$vb3db = mysql_connect("localhost","$vb3username","$vb3password");
                  		if (!vb3db)
                  				die("Couldn't connect to Database");
                  		mysql_select_db('$vb3database')
                  				or die("couldn't connectsss to $Db");
                  function safe_query($query = "",$db)
                  {
                  $result = mysql_query($query,$db)
                  		or die("Whoops! query failed: "
                  				."<li>Error Number = ".mysql_errno()
                  				."<li>Error = ".mysql_error()
                  				."<li>Query = ".$query
                  		);
                  return $result;
                  }
                   
                  $getoldusersq = "SELECT ibf_members_converge.*, ibf_members.name FROM ibf_members_converge, ibf_members WHERE ibf_members_converge.converge_id = ibf_members.id";
                  $getoldusersr = safe_query($getoldusersq, $ipbdb);
                  $x = 0;
                  $y = 0;
                  while ($getoldusers = mysql_fetch_array($getoldusersr))
                  {
                  		echo "checking for user $getoldusers[name]\n";
                  		$getnewuserq = "SELECT * FROM user WHERE username = '$getoldusers[name]' LIMIT 1";
                  		$getnewuserr = safe_query($getnewuserq, $vb3db);
                  		if (mysql_num_rows($getnewuserr) == 1)
                  		{
                  				$getnewuser = mysql_fetch_array($getnewuserr);
                  				echo "Found user $getnewuser[username] $getnewuser[userid]\n";
                  				$x++;
                  				$prettysalt = addslashes($getoldusers[converge_pass_salt]);
                  				safe_query("UPDATE user SET password = '$getoldusers[converge_pass_hash]', salt='$prettysalt' WHERE userid ='$getnewuser[userid]'", $vb3db);
                  		}
                  		else
                  		{
                  				echo "FAILED TO FIND $getolduser[name] ----------------------------------------------- \n";
                  		}
                  $y++;
                  }
                  echo "tried to edit $x users, and was successful in editing $y users.\n";
                  ?>
                  I would suggest running this in a command prompt, as its easier to debug and play with, but if not, a webpage will work. Just paste that code above in something like convert.php and run php convert.php or put it in your web directory, and go to that site.

                  Please do not bash me for an ugly hack, as this code is provided AS IS.

                  I forgot to mention. Your users will be able to log in both ways, with a new user name, if they created one, and their old ipb username and password. What you MIGHT want to have them do is change their password, but they dont have to, as this authenticates both ways now.

                  Comment


                  • #10
                    best of lcuk

                    Comment


                    • #11
                      I don't recommend using the above hack.....personally, I think it's opening the door to potential problems in the future
                      ManagerJosh, Owner of 4 XenForo Licenses, 1 vBulletin Legacy License, 1 Internet Brands Suite License
                      Director, WorldSims.org | Gaming Hosting Administrator, SimGames.net, Urban Online Entertainment

                      Comment


                      • #12
                        I would love to know how you think its opening a door to potential problems... All it does is add a line of acceptable username password authentications, allows the salt to be 5 characters insted of 3, and imports all of the raw hashes and salts. Seems pretty strait foreward.

                        We have tested it out bringing in old users, and then having that user do things on the board, and then having that user change their password, and they can still login, they switch over to the hash that vb3 uses as well as the salt, and no problems arose. So how can this be a bad thing?

                        Comment


                        • #13
                          Yeah the hack does look sound btw and I've already suggested this method before.

                          Though when it found a 5 character salt AND it matched, it would generate a new 3 character salt for the user bringing them in line with the ideal system.
                          Scott MacVicar

                          My Blog | Twitter

                          Comment


                          • #14
                            Originally posted by Scott MacVicar
                            Yeah the hack does look sound btw and I've already suggested this method before.

                            Though when it found a 5 character salt AND it matched, it would generate a new 3 character salt for the user bringing them in line with the ideal system.
                            So that code would be okay to use? Wish I knew that before when I transfered from IPB2...
                            Congratulations on the death of vBulletin, Internet Brands.

                            Comment


                            • #15
                              It could be done with virtually any password system that we can't translate, but since it involves hacking it isn't recommended.

                              But now that we have hooks I think it would be possible for any new 3.5 imports to have a fallback login to set the new password. Though this is something I'd need to speak with the rest of the team and Jerry about.
                              Scott MacVicar

                              My Blog | Twitter

                              Comment

                              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                              Working...
                              X