Announcement

Collapse
No announcement yet.

phpbb to phpnuke, now to vbulletin. need db help

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

  • phpbb to phpnuke, now to vbulletin. need db help

    I imported my phpbb db into a fresh install of phpnuke a couple years ago. Now I'm trying to import everything I can from nuke into vbulletin. I know, vbulletin can't import things like polls, and other module info. I was hoping to tackle that import with vbadvance later. But my main concern is importing all of my users, posts, and everything else in the forums over to vbulletin. The rest I can live without.

    Source - phpBB2 - 2.0.19
    Target - vBulletin 3.6.5
    Module - 001 - Check and update Database

    Valid found tables :


    Possiablly custom tables or incorrect prefix :

    attachments NOT found.
    attachments_desc NOT found.
    auth_access NOT found.
    banlist NOT found.
    categories NOT found.
    config NOT found.
    confirm NOT found.
    disallow NOT found.
    forum_prune NOT found.
    forums NOT found.
    groups NOT found.
    posts NOT found.
    posts_text NOT found.
    privmsgs NOT found.
    privmsgs_text NOT found.
    ranks NOT found.
    search_results NOT found.
    search_wordlist NOT found.
    search_wordmatch NOT found.
    sessions NOT found.
    smilies NOT found.
    themes NOT found.
    themes_name NOT found.
    topics NOT found.
    topics_watch NOT found.
    user_group NOT found.
    users NOT found.
    vote_desc NOT found.
    vote_results NOT found.
    vote_voters NOT found.
    words NOT found.

    If you have all red tables, i.e. none correct this could possible be your table prefix :

    nuke_bb
    my db name is php3, and in the db I have nuke_ prefix's, and phpbb_prefix's, then I have some tables with no prefix at all, but begin with nuke (ie. nuketblname). I've tried prefix nuke_, phpbb_, nuke_bb, nuke_auth, nuke, phpbb, everything I can think of with no luck.

    Anyone have any tips, tricks, or want to make a quick buck to get me converted?

    Thanks in advance.

  • #2
    I converted my site some time ago, so I don't know if things have changed since then, but you have to convert from nuke, back to phpbb (using the converter script which can be found at phpbb.com) and then with Impex, convert the db from phpbb to vb.

    It wasn't clear to me from what you wrote if you have already done that. Apologies if you already knew all of the above.

    Comment


    • #3
      nah i haven't converted it back to phpbb yet. i didn't even think about that. thanks for the input. i'll try it and post backup and let you know.

      thanks again

      Comment


      • #4
        ok, i converted nuke to bb. all the forums, and users, and posts were imported to bb. i tested with bb and when i logged in under my username i got this error

        4
        5.0.19ùa]0u"Cmx,¢5;h}\516[H9!ÿBad handshake
        if i refresh the page i'm logged in and can view everything. the same happens when i log out.

        considering that could be a bb problem i went ahead and tried impex import from bb to vb. everything seemed to go fine. after the import i try accessing the admin panel and it loops back to the admin panel after accepting the credentials. i tried the tools.php script that comes with vb 3.6.x but nothing happened. so i try to look at the forums and i get this

        You have been banned for the following reason:
        No reason was specified.

        Date the ban will be lifted: Never
        any ideas?

        Comment


        • #5
          in case it helps this is the code i used to go from nuke to bb.

          PHP Code:
          <?php
          /***********************************
          ** PHP-Nuke --> phpBB forum converter
          ** v1.2.13

          ** Use of this script is at your own risk.
          ** The authors of this script will not be responsible for any data loss.

          ** Read the readme.txt file included with this package for instructions
          **   before running this convertor.
          ***********************************/

          define('IN_PHPBB'true);
          $phpbb_root_path './';
          include(
          $phpbb_root_path 'extension.inc');
          include(
          $phpbb_root_path 'common.'.$phpEx);

              function 
          failed $query="" ) {
              print(
          "Failed<br />");
              if ( 
          $query != "" ) {
                print(
          "<ul><b>Query</b><br />".$query."</ul>");
              }
              print(
          "<ul><b>Reason</b><br />".mysql_errno().": ".mysql_error()."</ul>");
              exit;
            }

            
          /** this function added by Jaymer... just a copy from Graham's post on phpbb.com **/
              
          function sql_addslashes($txt)
              {
                     
          $txt addslashes($txt);
                     return 
          str_replace("\\'""''"$txt);
              }

              function 
          mysql_query_fail $query ) {
          /** original by lamb          return @mysql_query(addslashes($query)) or failed($query);   
               took out the addslash call here     jaymer nov-12-2004   **/
              
          return @mysql_query($query) or failed($query);
                }
                
                function 
          query($sql$errormsg
                  { 
                      global 
          $db
                      if(!
          $result $db->sql_query($sql)) 
                          { 
                              print 
          "<br /><font color=\"red\">\n"
                              print 
          "$errormsg<br />"
                              
          $sql_error $db->sql_error(); 
                              print 
          $sql_error['code'] .": "$sql_error['message']. "<br />\n"
                              print 
          "<pre>$sql</pre>"
                              print 
          "</font>\n"
                              return 
          FALSE
                          } 
                      else 
                          { 
                              return 
          $result
                          } 
                  }

          // PHP5 with register_long_arrays off?
              
          if (!isset($HTTP_POST_VARS) && isset($_POST))
              {
                  
          $HTTP_POST_VARS $_POST;
                  
          $HTTP_GET_VARS $_GET;
              }
                  
          if ( isset(
          $HTTP_POST_VARS['config'])) {
                  
                  
          $config $HTTP_POST_VARS['config'];
          //        $config = ( isset($HTTP_GET_VARS['config']) ) ? $HTTP_GET_VARS['config'] : $HTTP_POST_VARS['config'];
                  
          $listf '';
          define('NUKE_DATABASE',$config['nuke_db'] . '.');
          define('PHPBB_DATABASE',$config['phpbb_db'] . '.');
          @
          set_time_limit(0);

            print(
          "Connecting to PHP-Nuke database server...");
            if ( @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']) ) {
              print(
          "Success<br>");
            } else {
              
          failed();
            }

            print(
          "Connecting to PHP-Nuke database...");
            if ( @
          mysql_select_db($config['nuke_db']) ) {
              print(
          "Success<br>");
            } else {
              
          failed();
            }

            print(
          "Connecting to phpBB database server...");
            if ( @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']) ) {
              print(
          "Success<br>");
            } else {
              
          failed();
            }

            print(
          "Connecting to phpBB database...");
            if ( @
          mysql_select_db($config['phpbb_db']) ) {
              print(
          "Success<br>");
            } else {
              
          failed();
            }

          //    $array = array("disallow","categories","forums","posts_text", "privmsgs","privmsgs_text","topics_watch","words","vote_desc","vote_results","vote_voters","search_wordlist","search_wordmatch");
              
          $array = array("disallow","categories","forums","posts_text""privmsgs","privmsgs_text","topics_watch","words","vote_desc","vote_results","vote_voters");

            foreach ( 
          $array as $table ) {
              print(
          "Exporting data from PHP-Nuke table: ".$table."...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bb".$table);
                  
              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail('DELETE FROM ' $config['phpbb_prefix'].$table);

              while ( 
          $row = @mysql_fetch_array($res) )
              {

                  
          $query "INSERT INTO ".$config['phpbb_prefix'].$table." (";
                  foreach ( 
          $row as $name => $cell )
                  {
                      if ( ! 
          is_int($name) )
                      {
                        
          $query .= $name.",";
                      }
                    }
                    
          reset($row);
                    
          $query substr($query0, -1);
                    
          $query .= ") values (";
                    foreach ( 
          $row as $name => $cell ) {
                      if ( ! 
          is_int($name) ) {

          /** original by lamb           $query .= "'".$cell."',";
              added the call to sql_addslashes so the CONTENT of a field would be escaped **/
                    
          $query .= "'".sql_addslashes($cell)."',";
                  }
                }

                
          $query substr($query0, -1);
                
          $query .= ")";
          /**   if you are getting a 1064 error, uncomment the next line to see each SQL statement as its being executed.  Jaymer... **/
          //        echo $query;

                
          @mysql_query_fail($query);
              }
              print(
          "Success<br>");
            }

              print(
          "Exporting data from PHP-Nuke configuration tables...");
              
              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
              
                  
          $res = @mysql_query("SELECT * FROM ".NUKE_DATABASE.$config['nuke_prefix'].bbconfig);
                  
          $config_count $db->sql_numrows($res); 
                  
          $row $db->sql_fetchrowset($res);
                  
              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);
                  
              
          $table config;

                  for (
          $i 0$i $config_count$i++)
                  {
                      
          $config_data $row[$i]['config_value'];
                      
          $conf_name $row[$i]['config_name'];

                       if (
          $conf_name == 'avatar_max_width')
                       {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE  `config_name` = 'avatar_max_width'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update avatars width table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'avatar_max_height')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE  `config_name` = 'avatar_max_height'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update avatars height table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'avatar_filesize')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE  `config_name` = 'avatar_filesize' ";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update avatars size table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'allow_html')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE  `config_name` = 'allow_html'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update allow_html table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'allow_html_tags')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = '" $config_data "' WHERE  `config_name` = 'allow_html_tags'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update allow_html_tags table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'allow_bbcode')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE  `config_name` = 'allow_bbcode'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update allow_bbcode table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'max_sig_chars')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'max_sig_chars'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update config_sig table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'sitename')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = '" $config_data "' WHERE config_name = 'sitename'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update site_name table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'site_desc')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = '" addslashes($config_data) . "' WHERE config_name = 'site_desc'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update site description table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'board_email')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = '" $config_data "' WHERE config_name = 'board_email'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update board email address table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }

                      if (
          $conf_name == 'board_timezone')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'board_timezone'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update board time zone table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'require_activation')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'require_activation'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update require activation table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'privmsg_disable')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'privmsg_disable'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update allow private messages table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'max_inbox_privmsgs')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'max_inbox_privmsgs'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't max inbox private messages table!"""__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'max_sentbox_privmsgs')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'max_sentbox_privmsgs'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update max private messages sentbox table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                      if (
          $conf_name == 'max_savebox_privmsgs')
                      {
                      
          $sql "UPDATE " PHPBB_DATABASE $config['phpbb_prefix'].$table " SET config_value = " $config_data " WHERE config_name = 'max_savebox_privmsgs'";
                      
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR,"Couldn't update amax private messages savebox table!""Conversion ERROR"__LINE____FILE__$sql);
                          }
                      }
                  }
              print(
          "Success<br />");
              
          // Set authorization access

            
          print("Exporting data from PHP-Nuke table: auth_access...");
            
              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbauth_access");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

            @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."auth_access");

            while ( 
          $row = @mysql_fetch_array($res) )
              {
              
          $query "INSERT INTO ".$config['phpbb_prefix']."auth_access (`group_id`, `forum_id`, `auth_view`, `auth_read`, `auth_post`, `auth_reply`, `auth_edit`, `auth_delete`, `auth_sticky`, `auth_announce`, `auth_vote`, `auth_pollcreate`, `auth_attachments`, `auth_mod`) VALUES (
                           '"
          .$row['group_id']."','".$row['forum_id']."','".$row['auth_view']."','".$row['auth_read']."','".$row['auth_post']."','".$row['auth_reply']."','".$row['auth_edit']."','".$row['auth_delete']."','".$row['auth_sticky']."','".$row['auth_announce']."','".$row['auth_vote']."','".$row['auth_pollcreate']."','".$row['auth_attachments']."','".$row['auth_mod']."')";
              @
          mysql_query_fail($query);

          /*        $result1 = $db->sql_query($query);
                          if ( !$result1 )
                          {
                              message_die(GENERAL_ERROR, "Could not insert data for phpbb auth access table", "", __LINE__, __FILE__, $query);
                          } */
              
          }

                print(
          "Success<br />");
            
              print(
          "Exporting data from PHP-Nuke tables: topics...");
              
              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
             
              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbtopics");
              
          /*    $sql = 'SELECT * FROM ' . NUKE_DATABASE . $config['nuke_prefix'] . 'bbtopics';
              $res = $db->sql_query($sql);
              if( !$res )
                  {
                      message_die(GENERAL_ERROR, "Couldn't get topics data!", "", __LINE__, __FILE__, $sql);
                  } */


              
          @mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);
              
              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."topics");


          /*  $sql = "DELETE FROM ".PHPBB_DATABASE.$config['phpbb_prefix']."topics";
                  $result = $db->sql_query($sql);
                  if ( !$result )
                  { 
                  message_die(GENERAL_ERROR, 'Could not delete from phpbb topics table!', '', __LINE__, __FILE__, $sql);
                  } */
                  
              
          while ( $row = @mysql_fetch_array($res) )
              {
                  
          $poster_id = (($row['topic_poster'] != 1) ? $row['topic_poster'] : '-1');

              
          $query "INSERT INTO ".$config['phpbb_prefix']."topics (
              `topic_id`, 
              `forum_id`, 
              `topic_title`, 
              `topic_poster`, 
              `topic_time`, 
              `topic_views`, 
              `topic_replies`, 
              `topic_status`, 
              `topic_vote`, 
              `topic_type`, 
              `topic_first_post_id`, 
              `topic_last_post_id`, 
              `topic_moved_id`) VALUES (
                  '"
          .$row['topic_id']."', 
                  '"
          .$row['forum_id']."',
                  '"
          .sql_addslashes($row['topic_title'])."',
                  '"
          .$poster_id."',
                  '"
          .$row['topic_time']."',
                  '"
          .$row['topic_views']."',
                  '"
          .$row['topic_replies']."',
                  '"
          .$row['topic_status']."',
                  '"
          .$row['topic_vote']."',
                  '"
          .$row['topic_type']."',
                  '"
          .$row['topic_first_post_id']."',
                  '"
          .$row['topic_last_post_id']."',
                  '"
          .$row['topic_moved_id']."'
                  )"
          ;
              
                  @
          mysql_query_fail($query);
              }
              print(
          "Success<br />");
              
              print(
          "Exporting data from PHP-Nuke tables: posts...");
              
              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
              
              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbposts");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."posts");

              while ( 
          $row = @mysql_fetch_array($res) )
              {
                  
          $poster_id = (($row['poster_id'] != 1) ? $row['poster_id'] : '-1');
                  
              
          $query "INSERT INTO ".$config['phpbb_prefix']."posts (
              `post_id`, 
              `topic_id`, 
              `forum_id`, 
              `poster_id`, 
              `post_time`, 
              `poster_ip`, 
              `post_username`, 
              `enable_bbcode`, 
              `enable_html`, 
              `enable_smilies`, 
              `enable_sig`, 
              `post_edit_time`, 
              `post_edit_count`) VALUES (
                  '"
          .$row['post_id']."', 
                  '"
          .$row['topic_id']."',
                  '"
          .$row['forum_id']."',
                  '"
          .$poster_id."',
                  '"
          .$row['post_time']."',
                  '"
          .$row['poster_ip']."',
                  '"
          .sql_addslashes($row['post_username'])."',
                  '"
          .$row['enable_bbcode']."',
                  '"
          .$row['enable_html']."',
                  '"
          .$row['enable_smilies']."',
                  '"
          .$row['enable_sig']."',
                  '"
          .$row['post_edit_time']."',
                  '"
          .$row['post_edit_count']."'
                  )"
          ;
                  
              @
          mysql_query_fail($query);

              }
              print(
          "Success<br />");
              
            print(
          "Exporting data from PHP-Nuke tables: users...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
              
              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."users");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."users");

              while ( 
          $row = @mysql_fetch_array($res) )
              {
              
          $time $row['user_regdate'];
              
          $date str_replace(",","",$time);
              
          $date explode(" ",$date);
                switch(
          $date[0]) {
                   case(
          'Jan'): $m=1;  break;
                   case(
          'Feb'): $m=2;  break;
                   case(
          'Mar'): $m=3;  break;
                   case(
          'Apr'): $m=4;  break;
                   case(
          'May'): $m=5;  break;
                   case(
          'Jun'): $m=6;  break;
                   case(
          'Jul'): $m=7;  break;
                   case(
          'Aug'): $m=8;  break;
                   case(
          'Sep'): $m=9;  break;
                   case(
          'Oct'): $m=10; break;
                   case(
          'Nov'): $m=11; break;
                   case(
          'Dec'): $m=12; break;
                }

              
          $timestamp date("U"gmmktime(0,0,0,$m,$date[1],$date[2]));
              
          $user_level $row['user_level'] - 1;
              
          $user_style 1;

          /*   jaymer - had to explicitly use field names for the INSERT, plus
          added the "slash" stuff below on a few fields.   */
              
          $query "INSERT INTO ".$config['phpbb_prefix']."users
          (user_id,
          user_active,
          username,
          user_password,
          user_session_time,
          user_session_page,
          user_lastvisit,
          user_regdate,
          user_level,
          user_posts,
          user_timezone,
          user_style,
          user_lang,
          user_dateformat,
          user_new_privmsg,
          user_unread_privmsg,
          user_last_privmsg,
          user_emailtime,
          user_viewemail,
          user_attachsig,
          user_allowhtml,
          user_allowbbcode,
          user_allowsmile,
          user_allowavatar,
          user_allow_pm,
          user_allow_viewonline,
          user_notify,
          user_notify_pm,
          user_popup_pm,
          user_rank,
          user_avatar,
          user_avatar_type,
          user_email,
          user_icq,
          user_website,
          user_from,
          user_sig,
          user_sig_bbcode_uid,
          user_aim,
          user_yim,
          user_msnm,
          user_occ,
          user_interests,
          user_actkey,
          user_newpasswd
          ) values (
                        '"
          .$row['user_id']."',
                        '"
          .$row['user_active']."',
                        '"
          .sql_addslashes($row['username'])."',
                        '"
          .$row['user_password']."',
                        '"
          .$row['user_session_time']."',
                        '"
          .$row['user_session_page']."',
                        '"
          .$row['user_lastvisit']."',
                        '"
          .$timestamp."',
                        '"
          .$user_level."',
                        '"
          .$row['user_posts']."',
                        '"
          .$row['user_timezone']."',
                        '"
          .$user_style."',
                        '"
          .$row['user_lang']."',
                        '"
          .$row['user_dateformat']."',
                        '"
          .$row['user_new_privmsg']."',
                        '"
          .$row['user_unread_privmsg']."',
                        '"
          .$row['user_last_privmsg']."',
                        '"
          .$row['user_emailtime']."',
                        '"
          .$row['user_viewemail']."',
                        '"
          .$row['user_attachsig']."',
                        '"
          .$row['user_allowhtml']."',
                        '"
          .$row['user_allowbbcode']."',
                        '"
          .$row['user_allowsmile']."',
                        '"
          .$row['user_allowavatar']."',
                        '"
          .$row['user_allow_pm']."',
                        '"
          .$row['user_allow_viewonline']."',
                        '"
          .$row['user_notify']."',
                        '"
          .$row['user_notify_pm']."',
                        '"
          .$row['user_popup_pm']."',
                        '"
          .$row['user_rank']."',
                        '"
          .sql_addslashes($row['user_avatar'])."',
                        '"
          .$row['user_avatar_type']."',
                        '"
          .$row['user_email']."',
                        '"
          .$row['user_icq']."',
                        '"
          .$row['user_website']."',
                        '"
          .sql_addslashes($row['user_from'])."',
                        '"
          .sql_addslashes($row['user_sig'])."',
                        '"
          .$row['user_sig_bbcode_uid']."',
                        '"
          .sql_addslashes($row['user_aim'])."',
                        '"
          .sql_addslashes($row['user_yim'])."',
                        '"
          .sql_addslashes($row['user_msnm'])."',
                        '"
          .sql_addslashes($row['user_occ'])."',
                        '"
          .sql_addslashes($row['user_interests'])."',
                        '"
          .$row['user_actkey']."',
                        '"
          .$row['user_newpasswd']."'
                        )"
          ;
          /*    echo $query;     */

              
          @mysql_query_fail($query);

            }
            
          $table "users";
            
              
          $sql "UPDATE " $config['phpbb_prefix'] . $table " SET user_id = '-1', user_active = '0' WHERE username = 'Anonymous'";
              
          $result $db->sql_query($sql);
                          if ( !
          $result )
                          {
                              
          message_die(GENERAL_ERROR"Could not update anonymous user in phpbb users table"""__LINE____FILE__$sql);
                          }
              
            print(
          "Success<br />");
          /******************************************************************************************************/
              
          print("Moving groups data from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);
              
              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbgroups WHERE group_id > 1");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);
              
              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."groups WHERE `group_id` > 1");

              while ( 
          $group = @mysql_fetch_array($res) )
              {
                  
          $group_name sql_addslashes($group['group_name']);
                  
          $group_desc sql_addslashes($group['group_description']);
                  
          $query "INSERT INTO ".$config['phpbb_prefix']."groups VALUES ('".$group['group_id']."','".$group['group_type']."','".$group_name."','".$group_desc."','".$group['group_moderator']."','".$group['group_single_user']."')";
                  @
          mysql_query_fail($query);
              }
              print(
          "Success<br />");
          /******************************************************************************************************/
            
          print("Moving usergroup data from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbuser_group WHERE group_id > 1");
              
              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."user_group WHERE `group_id` > 1");

              while ( 
          $group = @mysql_fetch_array($res) )
              {
                  
          $query "INSERT INTO ".$config['phpbb_prefix']."user_group VALUES ('".$group['group_id']."','".$group['user_id']."','".$group['user_pending']."')";
                  @
          mysql_query_fail($query);
              }
                print(
          "Success<br />");
          /******************************************************************************************************/
            // banlist data conversion

            
          print("Moving banlist data from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbbanlist");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."banlist");

              while ( 
          $banlist = @mysql_fetch_array($res) )
              {
                  
          $query "INSERT INTO ".$config['phpbb_prefix']."banlist VALUES ('".$banlist['ban_id']."','".$banlist['ban_userid']."','".$banlist['ban_ip']."','".$banlist['ban_email']."')";
                  @
          mysql_query_fail($query);
              }
                print(
          "Success<br />");
          /******************************************************************************************************/
              // ranks data conversion

            
          print("Moving ranks data from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbranks");

              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."ranks");

              while ( 
          $rnk = @mysql_fetch_array($res) )
              {
                  
          $rank_title sql_addslashes($rnk['rank_title']);
                  
          $query "INSERT INTO ".$config['phpbb_prefix']."ranks values ('".$rnk['rank_id']."','".$rank_title."','".$rnk['rank_min']."','".$rnk['rank_special']."','".$rnk['rank_image']."')";
                  @
          mysql_query_fail($query);
              }
              print(
          "Success<br />");
          /******************************************************************************************************/     
          // Insert missing user groups - original script by dkklein, modified by Dicky

              
          $sql "SELECT user_id, username
              FROM " 
          $config['phpbb_prefix']."users
              WHERE user_id > 0"
          ;
          if ( !(
          $result $db->sql_query($sql)) )
          {
              
          message_die(GENERAL_ERROR'Could not obtain user list'''__LINE____FILE__$sql);
          }

           
          $liste ='';
          while ( 
          $row $db->sql_fetchrow($result) )
              {
                     
          $username $row['username'];
                     
          $user_id $row['user_id'];
                     
          $usergroup '';
             
                  
          $sql1 "SELECT ug.group_id
                    FROM " 
          PHPBB_DATABASE $config['phpbb_prefix']."user_group ug, "$config['phpbb_prefix']."groups g 
                    WHERE ug.user_id = 
          $user_id
                      AND ug.group_id = g.group_id
                      AND g.group_single_user  = 1
                      "
          ;
                       
                 if ( (
          $result1 $db->sql_query($sql1)) )
                 {
                 
          $row1 $db->sql_fetchrow($result1);
                    
          $usergroup =( ( $row1['group_id'] != '' ) ? $row1['group_id'] : 'User has no user group'.$row1 );
                 }

              if (!(
          $row1['group_id'] != ''))
              {
                       
                   
          $sql2 "SELECT MAX(group_id) AS total
                      FROM " 
          $config['phpbb_prefix']."groups";
                   if ( !(
          $result2 $db->sql_query($sql2)) )
                   {
                      
          message_die(GENERAL_ERROR'Could not obtain next group_id information'''__LINE____FILE__$sql2);
                   }

                   if ( !(
          $row2 $db->sql_fetchrow($result2)) )
                   {
                      
          message_die(GENERAL_ERROR'Could not obtain next group_id information'''__LINE____FILE__$sql2);
                   }
                   
          $group_id $row2['total'] + 1;
                   
                   
          $sql3 "INSERT INTO " $config['phpbb_prefix']."groups (group_id, group_name, group_description, group_single_user, group_moderator)
                      VALUES (
          $group_id, '', 'Personal User', 1, 0)";
                   if ( !(
          $result3 $db->sql_query($sql3BEGIN_TRANSACTION)) )
                   {
                      
          message_die(GENERAL_ERROR'Could not insert data into groups table'''__LINE____FILE__$sql3);
                   }

                   
          $sql4 "INSERT INTO " $config['phpbb_prefix']."user_group (user_id, group_id, user_pending)
                      VALUES (
          $user_id$group_id, 0)";
                   if( !(
          $result4 $db->sql_query($sql4END_TRANSACTION)) )
                   {
                      
          message_die(GENERAL_ERROR'Could not insert data into user_group table'''__LINE____FILE__$sql4);
                   }
                       
                 
          $usergroup $usergroup.', adding user group '.$group_id;
              }


          //    $liste .= ( ( $liste != '' ) ? '<br /> ' : '' ) . $username.' <b>'.$usergroup.'</b>';
              
          }

          //    message_die(GENERAL_MESSAGE,'<br /><br /><b>The conversion has been a success</b><br /><br />'.$liste,'Conversion Information');
          //    message_die(GENERAL_MESSAGE,$listf.'<br /><br /><b>The conversion has been a success</b>','Conversion Information');
          /******************************************************************************************************/
          // Transfer search wordlists
          /* @mysql_query_fail("TRUNCATE TABLE ".$config['phpbb_prefix']."search_wordlist");
            print("Moving search wordlist data from PHP-Nuke -> phpBB...");
          $sql = ' INSERT INTO ' . $config['phpbb_prefix'] . 'search_wordlist SELECT * FROM ' . $config['nuke_prefix'] . 'bbsearch_wordlist';
                      $result = $db->sql_query($sql);
                          if ( !$result )
                          {
                              message_die(GENERAL_ERROR,"Couldn't transfer search word list table!", "Conversion ERROR", __LINE__, __FILE__, $sql);
                          }
              print("Success<br />");

          @mysql_query_fail("TRUNCATE TABLE ".$config['phpbb_prefix']."search_wordmatch");
            print("Moving search wordmatch data from PHP-Nuke -> phpBB...");
          $sql = ' INSERT INTO ' . $config['phpbb_prefix'] . 'search_wordmatch SELECT * FROM ' . $config['nuke_prefix'] . 'bbsearch_wordmatch';
                      $result = $db->sql_query($sql);
                          if ( !$result )
                          {
                              message_die(GENERAL_ERROR,"Couldn't transfer search word match table!", "Conversion ERROR", __LINE__, __FILE__, $sql);
                          }
              print("Success<br />"); */
          /******************************************************************************************************/
          // Transfer search wordlists
            
          print("Moving search wordlists from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbsearch_wordlist");
              
              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."search_wordlist");

              while ( 
          $search = @mysql_fetch_array($res) )
              {
                  
          $query "INSERT INTO " $config['phpbb_prefix'] . "search_wordlist VALUES ('".$search['word_text']."','".$search['word_id']."','".$search['word_common']."')";
                  @
          mysql_query_fail($query);
              }
                print(
          "Success<br />");

          // Transfer search wordmatch
            
          print("Moving search_word_match data from PHP-Nuke -> phpBB...");

              @
          mysql_connect($config['nuke_server'],$config['nuke_username'],$config['nuke_password']);
              
          mysql_select_db($config['nuke_db']);

              
          $res = @mysql_query("SELECT * FROM ".$config['nuke_prefix']."bbsearch_wordmatch");
              
              @
          mysql_connect($config['phpbb_server'],$config['phpbb_username'],$config['phpbb_password']);
              
          mysql_select_db($config['phpbb_db']);

              @
          mysql_query_fail("DELETE FROM ".$config['phpbb_prefix']."search_wordmatch");

              while ( 
          $search = @mysql_fetch_array($res) )
              {
                  
          $query "INSERT INTO ".$config['phpbb_prefix']."search_wordmatch VALUES ('".$search['post_id']."','".$search['word_id']."','".$search['title_match']."')";
                  @
          mysql_query_fail($query);
              }
                print(
          "Success<br />");
          /******************************************************************************************************/
          print("<br /><br /><b>The conversion has been a success</b><br /><br />");


          else {
          print (
          "<html>
          <head>
          <title>phpNuke v7.7 to phpBB 2.0.x convertor</title>
          </head>
          <body bgcolor=\"#E5E5E5\" text=\"#000000\">
          <h2>phpNuke v7.7 to phpBB 2.0.x convertor</h2>
          <font size=4>Enter configuration data</font><br /><br />

           <form method=post>
          <table border=0>
          <!--
          <tr><td>PHP-Nuke Server name:</td><td><b>localhost</b><input type=hidden value='localhost' name='config[nuke_server]'></td></tr>
          -->
          <tr><td>PHP-Nuke Server name:</td><td><input type=text value='localhost' name='config[nuke_server]'></td></tr>
          <tr><td>PHP-Nuke Database name:</td><td><input type=text name='config[nuke_db]'></td></tr>
          <tr><td>PHP-Nuke Database username:</td><td><input type=text name='config[nuke_username]'></td></tr>
          <tr><td>PHP-Nuke Database password:</td><td><input type=password name='config[nuke_password]'></td></tr>
          <tr><td>PHP-Nuke table prefix:</td><td><input type=text value='nuke_' name='config[nuke_prefix]'></td></tr>
          <tr><td>&nbsp;</td><td>&nbsp;</td></tr>
          <!--
          <tr><td>phpBB Server name:</td><td><b>localhost</b><input type=hidden value='localhost' name='config[phpbb_server]'></td></tr>
          -->
          <tr><td>phpBB Server name:</td><td><input type=text value='localhost' name='config[phpbb_server]'></td></tr>
          <tr><td>phpBB Database name:</td><td><input type=text name='config[phpbb_db]'></td></tr>
          <tr><td>phpBB Database username:</td><td><input type=text name='config[phpbb_username]'></td></tr>
          <tr><td>phpBB Database password:</td><td><input type=password name='config[phpbb_password]'></td></tr>
          <tr><td>phpBB table prefix:</td><td><input type=text value='phpbb_' name='config[phpbb_prefix]'></td></tr>
          <tr><td colspan=2><input type=submit value='Convert'></form></td></tr></table>
          </body>    
          </html>"
          );
          }
          ?>
          <hr>
          This script created by Jonny Lamb.<br />
          v1.2, v1.21 Modified by Jaymer Nov-12-2004<br />
          v1.2.13 by <a href='http://www.phpbb.com/phpBB/profile.php?mode=viewprofile&u=163542' target='_blank'>Dicky</a><br />
          <a href='http://www.phpbb.com/phpBB/viewtopic.php?t=304974' target '_blank'>Support</a>

          Comment


          • #6
            It sounds like you merge your Admin account with an imported one. To restore your Admin status, download the vB zip file for your version, then extract the 'tools.php' script from the 'do_not_upload' folder. Then upload this file to your Admin CP directory and run it from your browser. Use the appropriate option to promote your user to Admin using this option:

            [Reset Admin Access]

            Then immediately remove this script.

            After this, please follow the 'After the Import' instructions here:

            http://www.vbulletin.com/docs/html/impex_cleanup
            Steve Machol, former vBulletin Customer Support Manager (and NOT retired!)
            Change CKEditor Colors to Match Style (for 4.1.4 and above)

            Steve Machol Photography


            Mankind is the only creature smart enough to know its own history, and dumb enough to ignore it.


            Comment


            • #7
              ok, i got it. i was uploading only the tools.php file, but support told me the whole "install" folder had to be uploaded with it. thanks for the help.

              everything looks good so far, maybe a little house keeping, but majority of everything was imported without any problems. i'm having users log in for testing for a couple days before i roll everything out live.

              thanks again.

              Comment


              • #8
                Just for others reading this, it is highly advised that you revet to phpBB2 before doing the import as its by far the quickest and best route.
                I wrote ImpEx.

                Blog | Me

                Comment

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