Impex Nightmare
by
, 09-03-2007 at 08:14 AM (8021 Views)
After purchase of vBulletin Blog i was expecting Jelsoft to release Impex for vblogetin. Finally they released the impex yesterday and this turned my sunday exactly to a Bloddy Sunday. Thats why i strongly advise everyone who plans to import data to their vBulletin blog wait for the fixes.
The first problem was a missing file (ImpExDatabase_blog_001.php) inside impex. Because of this missing file impex didn't function at all. After waiting like 8 hour 45 minutes Jerry upload the file to impex and the main nightmare started.
On the first step of impex i started to receive a database error regardingWhen i checked the vBulletin Blog table structure and compared it with impex i found that the problem was related on a mistype on Impex. In order to solve the issue I edited and corrected these mistakes.Code:mpEx Database errormysql error: Invalid SQL: DESCRIBE blog_subscribepost importblogsubscribepostid
Fix :
Find all instances of subscribepost inside the following files and replace them with subscribeentry
ImpExModule.php line 101
impex_language.php line 491
vbfields.php line 598 - 600 - 601 - 602 - 603 - 604
After this fix i succesfully runned the first step. On the second step there is a huge logic mistake and in order to import any administrators entries you need to take admin privilidges from them. After second step i immediately started to receive database errors again. After deeply checking i found two other mis configure queries which caused the errors. The first database error i received is
As there is no posts fields inside blog_user table you need to correct the query at ImpExDatabase_blog_001.php file.Code:ImpEx Database errormysql error: Invalid SQL: INSERT INTO blog_user ( bloguserid, importbloguserid, title, description, options, viewoption, comments, lastblog, lastblogid, lastblogtitle, lastcomment, lastcommenter, lastblogtextid, posts, allowsmilie, subscribeown, subscribeothers, moderation, deleted, draft, options_everyone, options_buddy, options_ignore, ratingnum, ratingtotal, rating, pending, uncatposts ) VALUES ( '9489', '4', 'title', 'description', '0', 'all', '0', '0', '0', '', '0', '', '0', '116', '1', 'none', 'none', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' ) mysql error: Unknown column 'posts' in 'field list' mysql error number: 1054 Date: Monday 03rd 2007f September 2007 01:02:04 AM Database: serenity MySQL error:
Find
Replace this withCode:$Db_object->query(" INSERT INTO {$tableprefix}blog_user ( bloguserid, importbloguserid, title, description, options, viewoption, comments, lastblog, lastblogid, lastblogtitle, lastcomment, lastcommenter, lastblogtextid, posts, allowsmilie, subscribeown, subscribeothers, moderation, deleted, draft, options_everyone, options_buddy, options_ignore, ratingnum, ratingtotal, rating, pending, uncatposts ) VALUES ( '" . intval($this->get_value('mandatory', 'bloguserid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('mandatory', 'importbloguserid')) . "', '" . addslashes($this->get_value('nonmandatory', 'title')) . /* Default : Type : varchar(255) */ "', '" . addslashes($this->get_value('nonmandatory', 'description')) . /* Default : Type : mediumtext */ "', '" . intval($this->get_value('nonmandatory', 'options')) . /* Default : 0 Type : int(10) unsigned */ "', '" . $this->enum_check($this->get_value('mandatory', 'viewoption'), array('all','only','except'), 'all') . /* Default : all Type : enum('all','only','except') */ "', '" . intval($this->get_value('nonmandatory', 'comments')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'lastblog')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'lastblogid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . addslashes($this->get_value('nonmandatory', 'lastblogtitle')) . /* Default : Type : varchar(255) */ "', '" . intval($this->get_value('nonmandatory', 'lastcomment')) . /* Default : 0 Type : int(10) unsigned */ "', '" . addslashes($this->get_value('nonmandatory', 'lastcommenter')) . /* Default : Type : varchar(100) */ "', '" . intval($this->get_value('nonmandatory', 'lastblogtextid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'posts')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'allowsmilie')) . /* Default : Type : smallint(5) unsigned */ "', '" . $this->enum_check($this->get_value('mandatory', 'subscribeown'), array('none','usercp','email'), 'none') . /* Default : none Type : enum('none','usercp','email') */ "', '" . $this->enum_check($this->get_value('mandatory', 'subscribeothers'), array('none','usercp','email'), 'none') . /* Default : none Type : enum('none','usercp','email') */ "', '" . intval($this->get_value('nonmandatory', 'moderation')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'deleted')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'draft')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_everyone')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_buddy')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_ignore')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'ratingnum')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'ratingtotal')) . /* Default : Type : int(10) unsigned */ "', '" . floatval($this->get_value('nonmandatory', 'rating')) . /* Default : Type : float unsigned */ "', '" . intval($this->get_value('nonmandatory', 'pending')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'uncatposts')) . /* Default : 0 Type : int(10) unsigned */ "' ) ");
P.S : Carefull eyes will see that i removed another field named uncatposts because this is also not needed by vBulletin Blog.Code:$Db_object->query(" INSERT INTO {$tableprefix}blog_user ( bloguserid, importbloguserid, title, description, options, viewoption, comments, lastblog, lastblogid, lastblogtitle, lastcomment, lastcommenter, lastblogtextid, allowsmilie, subscribeown, subscribeothers, moderation, deleted, draft, options_everyone, options_buddy, options_ignore, ratingnum, ratingtotal, rating, pending ) VALUES ( '" . intval($this->get_value('mandatory', 'bloguserid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('mandatory', 'importbloguserid')) . "', '" . addslashes($this->get_value('nonmandatory', 'title')) . /* Default : Type : varchar(255) */ "', '" . addslashes($this->get_value('nonmandatory', 'description')) . /* Default : Type : mediumtext */ "', '" . intval($this->get_value('nonmandatory', 'options')) . /* Default : 0 Type : int(10) unsigned */ "', '" . $this->enum_check($this->get_value('mandatory', 'viewoption'), array('all','only','except'), 'all') . /* Default : all Type : enum('all','only','except') */ "', '" . intval($this->get_value('nonmandatory', 'comments')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'lastblog')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'lastblogid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . addslashes($this->get_value('nonmandatory', 'lastblogtitle')) . /* Default : Type : varchar(255) */ "', '" . intval($this->get_value('nonmandatory', 'lastcomment')) . /* Default : 0 Type : int(10) unsigned */ "', '" . addslashes($this->get_value('nonmandatory', 'lastcommenter')) . /* Default : Type : varchar(100) */ "', '" . intval($this->get_value('nonmandatory', 'lastblogtextid')) . /* Default : 0 Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'allowsmilie')) . /* Default : Type : smallint(5) unsigned */ "', '" . $this->enum_check($this->get_value('mandatory', 'subscribeown'), array('none','usercp','email'), 'none') . /* Default : none Type : enum('none','usercp','email') */ "', '" . $this->enum_check($this->get_value('mandatory', 'subscribeothers'), array('none','usercp','email'), 'none') . /* Default : none Type : enum('none','usercp','email') */ "', '" . intval($this->get_value('nonmandatory', 'moderation')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'deleted')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'draft')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_everyone')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_buddy')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'options_ignore')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'ratingnum')) . /* Default : Type : int(10) unsigned */ "', '" . intval($this->get_value('nonmandatory', 'ratingtotal')) . /* Default : Type : int(10) unsigned */ "', '" . floatval($this->get_value('nonmandatory', 'rating')) . /* Default : Type : float unsigned */ "', '" . intval($this->get_value('nonmandatory', 'pending')) . /* Default : 0 Type : int(10) unsigned */ "' ) ");
P.S 2: Because of the 10000 character limit the remaining is on the first comment









