# CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHI ################################################################################ if (!$active) { exit('Not active'); } define('IDIR', ($getcwd = getcwd()) ? $getcwd : '.'); include_once './../db_mysql.php'; // BACK UP YOUR DATABASE require_once './../ImpExConfig.php'; $targetserver = $impexconfig['target']['server']; $targetuser = $impexconfig['target']['user']; $targetpassword = $impexconfig['target']['password']; $targetdatabase = $impexconfig['target']['database']; $targettableprefix = $impexconfig['target']['tableprefix']; $targettablecharset = $impexconfig['target']['charset']; $Db_target = new DB_Sql_vb_impex(); $Db_target->appname = 'vBulletin:ImpEx Target'; $Db_target->appshortname = 'vBulletin:ImpEx Target'; $Db_target->type = 'mysql'; $Db_target->database = $targetdatabase; $Db_target->connect($targetserver, $targetuser, $targetpassword, 0, $targettablecharset); $Db_target->select_db($targetdatabase); // BACK UP YOUR DATABASE # Posts if ($do_posts) { $posts = $Db_target->query("SELECT postid, pagetext, title FROM " . $targettableprefix . "post"); while ($post = $Db_target->fetch_array($posts)) { $text = str_replace(array_keys($replacer), $replacer, $post['pagetext']); $title_text = str_replace(array_keys($replacer), $replacer, $post['title']); #$text = preg_replace('##siU', '', $text); #$title_text = preg_replace('##siU', '', $text);
$old_forum_path = 'phpBB/'; # e.g. http://example_target.com/vBulletin/showthread.php?t=343 $new_domain = 'http://example_target.com/'; $new_forum_path = 'vBulletin/'; $file_extenstion = 'php'; // php, php3, html, etc, whatever your vb board is running // BACK UP YOUR DATABASE ################################################################################################################## # CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHING BELOW THIS LINE # CHANGE NOTHIING BELOW THIS LINE # CHANGE NOTHI ################################################################################################################## include_once './../db_mysql.php'; include_once './../ImpExFunction.php'; include_once './../ImpExDatabaseCore.php'; // BACK UP YOUR DATABASE extract(parse_ini_file('./../ImpExConfig.php'), EXTR_SKIP); $Db_target = new DB_Sql_vb_impex(); $Db_target->appname = 'vBulletin:ImpEx Target'; $Db_target->appshortname = 'vBulletin:ImpEx Target'; $Db_target->type = 'mysql'; $Db_target->database = $targetdatabase; $Db_target->connect($targetserver, $targetuser, $targetpassword, 0); $Db_target->select_db($targetdatabase); $Imp_database = new ImpExDatabaseCore(); $thread_ids_array = $Imp_database->get_threads_ids($Db_target, $Db_target->type, $target_table_prefix); // BACK UP YOUR DATABASE # Posts if ($do_posts) { $posts = $Db_target->query("SELECT postid, pagetext FROM " . $targettableprefix . "post"); while ($post = $Db_target->fetch_array($posts)) { if (strrpos($post['pagetext'], $old_domain . $old_forum_path)) { $text = $post['pagetext'];
$targetdatabasetype = $config['Database']['dbtype'] ? $config['Database']['dbtype'] : 'mysql'; $targetserver = $config['MasterServer']['servername']; $targetuser = $config['MasterServer']['username']; $targetpassword = $config['MasterServer']['password']; $targetdatabase = $config['Database']['dbname']; $targettableprefix = $config['Database']['tableprefix']; $targettablecharset = $config['Mysqli']['charset']; } else { die($impex_phrases['cant_read_config']); } } } else { // No config die("Can't find ImpExConfig.php"); } $Db_target = new DB_Sql_vb_impex(); $Db_target->appname = 'vBulletin:ImpEx Target'; $Db_target->appshortname = 'vBulletin:ImpEx Target'; $Db_target->database = $targetdatabase; $Db_target->type = $targetdatabasetype; $Db_target->connect($targetserver, $targetuser, $targetpassword, 0, $targettablecharset); $Db_target->select_db($targetdatabase); $forumfields = array('moderator' => 'importmoderatorid', 'usergroup' => 'importusergroupid', 'ranks' => 'importrankid', 'poll' => 'importpollid', 'forum' => 'importforumid', 'forum' => 'importcategoryid', 'user' => 'importuserid', 'style' => 'importstyleid', 'thread' => 'importthreadid', 'post' => 'importthreadid', 'thread' => 'importforumid', 'smilie' => 'importsmilieid', 'pmtext' => 'importpmid', 'avatar' => 'importavatarid', 'customavatar' => 'importcustomavatarid', 'customprofilepic' => 'importcustomprofilepicid', 'post' => 'importpostid', 'attachment' => 'importattachmentid', 'filedata' => 'importfiledataid'); $blogfields = array('blog' => 'importblogid', 'blog_category' => 'importblogcategoryid', 'blog_categoryuser' => 'importblogcategoryid', 'blog_moderator' => 'importblogmoderatorid', 'blog_custom_block' => 'importcustomblockid', 'blog_groupmembership' => 'importbloggroupmembershipid', 'blog_rate' => 'importblograteid', 'blog_subscribeentry' => 'importblogsubscribeentryid', 'blog_subscribeuser' => 'importblogsubscribeuserid', 'blog_text' => 'importblogtextid', 'blog_trackback' => 'importblogtrackbackid', 'blog_user' => 'importbloguserid'); $cmsfields = array('cms_article' => 'importcmscontentid', 'cms_category' => 'importcmscategoryid', 'cms_grid' => 'importcmsgridid', 'cms_layout' => 'importcmslayoutid', 'cms_layoutwidget' => 'importid', 'cms_widget' => 'importcmswidgetid', 'cms_widgetconfig' => 'importid', 'cms_navigation' => 'importid', 'cms_node' => 'importcmsnodeid', 'cms_nodecategory' => 'importid', 'cms_nodeconfig' => 'importid', 'cms_nodeinfo' => 'importid', 'cms_rate' => 'importcmsrateid', 'cms_sectionorder' => 'importid'); switch ($_GET['type']) { case 'cms': $target = $cmsfields; break; case 'blog': $target = $blogfields;
$impexconfig['target']['databasetype'] = 'mysql'; $impexconfig['target']['server'] = trim($config['MasterServer']['servername']) . ":" . trim($config['MasterServer']['port']); $impexconfig['target']['user'] = trim($config['MasterServer']['username']); $impexconfig['target']['password'] = trim($config['MasterServer']['password']); $impexconfig['target']['database'] = trim($config['Database']['dbname']); $impexconfig['target']['tableprefix'] = trim($config['Database']['tableprefix']); $impexconfig['target']['charset'] = trim($config['Mysqli']['charset']); } } else { $using_local_config = '<p>' . $impex_phrases['using_impex_config'] . '</p>'; } // ############################################################################# // Database connect // ############################################################################# $Db_target = new DB_Sql_vb_impex(); $Db_source = new DB_Sql_vb_impex(); $Db_target->appname = 'vBulletin:ImpEx Target'; $Db_target->appshortname = 'vBulletin:ImpEx Target'; $Db_target->database = $impexconfig['target']['database']; $Db_target->type = $impexconfig['target']['databasetype']; $Db_target->connect($impexconfig['target']['server'], $impexconfig['target']['user'], $impexconfig['target']['password'], $impexconfig['target']['persistent'], $impexconfig['target']['charset']); $Db_target->select_db($impexconfig['target']['database']); // ############################################################################# // Session start // ############################################################################# $ImpEx = new ImpExController(); $session_state = $ImpEx->return_session($Db_target, $impexconfig['target']['tableprefix']); if ($session_state) { $ImpExSession = $session_state; } else { $ImpExSession = new ImpExSession();
/* * @package ImpEx.tools * */ // Id swapper. // Swaps all the userids in the database for the imported userid // THIS IS A GARRUNTEED WAY TO TRASH YOU DB !!! // COMPLETLY INVALIDATES SUPPORT // USE AT YOUR OWN RISK. // // I / we / the company takes no responsiability for you running this script // Jerry - jerry.hutchings@vbulletin.com define('DIR', ($getcwd = getcwd()) ? $getcwd : '.'); require_once DIR . '/db_mysql.php'; $Db_target = new DB_Sql_vb_impex(); $Db_target->server = 'localhost'; $Db_target->user = '******'; $Db_target->password = '******'; $Db_target->database = 'vb3'; $Db_target->connect(); $refrence_ids = array(); $ids = $Db_target->query("SELECT userid,importuserid FROM user where importuserid !='null'"); while ($id = $Db_target->fetch_array($ids)) { $refrence_ids[$id['userid']] = $id['importuserid']; } echo "<h4>Altering tables.........</h4>"; // ALTER TO UNSIGNED && DROP PRIMARY KEY $Db_target->query("ALTER TABLE `user` CHANGE `userid` `userid` INT( 10 ) NOT NULL"); $Db_target->query("ALTER TABLE `user` DROP PRIMARY KEY"); echo "<p>User table.....</p>";
// vbfields updater. // Updates the feilds in vbfields table to ensure that ImpEx has the latest // Dosn't input fields that don't exsist // // // I / we / the company takes no responsiability for you running this script // Jerry - jerry.hutchings@vbulletin.com define('DIR', ($getcwd = getcwd()) ? $getcwd : '.'); require_once DIR . '/db_mysql.php'; $targettableprefix = ''; $targetdatabasetype = 'mysql'; $targetserver = 'localhost'; $targetuser = '******'; $targetpassword = '******'; $targetdatabase = 'vb3'; $Db_target = new DB_Sql_vb_impex(); $Db_target->server = $targetserver; $Db_target->user = $targetuser; $Db_target->password = $targetpassword; $Db_target->database = $targetdatabase; $Db_target->connect(); $data_base_result = $Db_target->query("show tables"); while ($table = $Db_target->fetch_array($data_base_result)) { if ($table[0] != 'vbfields') { echo "<h4>'" . $table[0] . "'</h4>"; $table_result = $Db_target->query("DESCRIBE " . $table[0]); while ($row = $Db_target->fetch_array($table_result)) { // Check that it is in vBfields to start with $not_found = $Db_target->query_first("SELECT fieldid FROM vbfields WHERE fieldname='" . $row['Field'] . "' AND tablename='" . $table[0] . "'"); if ($not_found[0] == null) { echo "<h2><font color='red'>I found field " . $row['Field'] . " in table '" . $table[0] . "' and not in vbfields !</font></h2>";
require_once IDIR . '/ImpExConfig.php'; require_once IDIR . $impexconfig['system']['language']; } // ############################################################################# // Requires // ############################################################################# require_once IDIR . '/db_mysql.php'; require_once IDIR . '/ImpExFunction.php'; require_once IDIR . '/ImpExDatabaseCore.php'; require_once IDIR . '/ImpExDatabase_360.php'; require_once IDIR . '/ImpExModule.php'; require_once IDIR . '/ImpExSession.php'; require_once IDIR . '/ImpExController.php'; require_once IDIR . '/ImpExDisplay.php'; require_once IDIR . '/ImpExDisplayWrapper.php'; $Db_target = new DB_Sql_vb_impex(); $Db_source = new DB_Sql_vb_impex(); $Db_target->appname = 'vBulletin:ImpEx Target'; $Db_target->appshortname = 'vBulletin:ImpEx Target'; $Db_target->database = $impexconfig['target']['database']; $Db_target->type = $impexconfig['target']['databasetype']; $Db_target->connect($impexconfig['target']['server'], $impexconfig['target']['user'], $impexconfig['target']['password'], $impexconfig['target']['persistent'], $impexconfig['target']['charset']); $Db_target->select_db($impexconfig['target']['database']); // ############################################################################# // Session start // ############################################################################# $ImpExDisplay = new ImpExDisplay(); $ImpExDisplay->phrases =& $impex_phrases; $ImpEx = new ImpExController(); $ImpExSession = new ImpExSession(); $tire_1 = '';