-- ------------- -- Mtree to SobiPro Category Migration Scripts -- http://www.slurpitup.com/ -- Copyright 2012, Tarik Assagai -- -- Date: May 24 19:04:53 2012 -0500 -- -------------- -- find and replace uizb1_ with your table prefix -- -- BEFORE YOU START set uizb1_sobipro_language language field to en-GB default -- -- Category Settings Table -- insert into uizb1_sobipro_category (id, description) (select cat_id, cat_desc from jos_mt_cats); -- update all other fields in the category table -- update uizb1_sobipro_category set position = '0' where position IS NULL; update uizb1_sobipro_category set icon = '' where icon IS NULL; -- fill sobi relations table with Mtree category data -- insert into uizb1_sobipro_relations (id, pid, position) (select cat_id, cat_parent, ordering from jos_mt_cats where cat_id > '0'); update uizb1_sobipro_relations set pid = '1' where oType = ''; update uizb1_sobipro_relations set oType = 'category' where oType = ''; update uizb1_sobipro_relations set position = '1' where position IS NULL; update uizb1_sobipro_relations set validSince = '2012-05-22 00:00:00' where validSince IS NULL; update uizb1_sobipro_relations set validUntil = '0000-00-00 00:00:00' where validUntil IS NULL; -- fill sobi object table with Mtree category data -- insert into uizb1_sobipro_object (id, nid, name) (select cat_id, alias, cat_name from jos_mt_cats where cat_id > '0'); update uizb1_sobipro_object set approved = '1' where approved IS NULL; update uizb1_sobipro_object set confirmed = '0' where confirmed IS NULL; update uizb1_sobipro_object set cout = '0' where cout IS NULL; update uizb1_sobipro_object set coutTime = '0000-00-00 00:00:00' where coutTime IS NULL; update uizb1_sobipro_object set createdTime = '2012-05-22 00:00:00' where createdTime IS NULL; update uizb1_sobipro_object set defURL = '' where defURL IS NULL; update uizb1_sobipro_object set metaDesc = '' where metaDesc IS NULL; update uizb1_sobipro_object set metaKeys = '' where metaKeys IS NULL; update uizb1_sobipro_object set options = '' where options IS NULL; update uizb1_sobipro_object set oType = 'category' where oType IS NULL; update uizb1_sobipro_object set owner = '42' where owner IS NULL; update uizb1_sobipro_object set ownerIP = '::1' where ownerIP IS NULL; update uizb1_sobipro_object set params = '' where params IS NULL; update uizb1_sobipro_object set stateExpl = '' where stateExpl IS NULL; update uizb1_sobipro_object set parent = '1' where parent IS NULL; update uizb1_sobipro_object set state = '1' where state IS NULL; update uizb1_sobipro_object set validSince = '2012-05-22 00:00:00' where validSince IS NULL; update uizb1_sobipro_object set updatedTime = '2012-05-22 00:00:00' where updatedTime IS NULL; update uizb1_sobipro_object set updater = '42' where updater IS NULL; update uizb1_sobipro_object set updaterIP = '::1' where updaterIP IS NULL; update uizb1_sobipro_object set validUntil = '0000-00-00 00:00:00' where validUntil IS NULL; update uizb1_sobipro_object set version = '1' where version = '0'; -- insert categories into the language file -- update jos_mt_cats set title = 'name'; update jos_mt_cats set metakey = 'en-GB'; update jos_mt_cats set metadesc = 'category'; insert into uizb1_sobipro_language (sKey, sValue, id, oType) (select title, cat_name, cat_id, metadesc from jos_mt_cats where cat_id > '0'); update jos_mt_cats set title = 'description'; insert into uizb1_sobipro_language (sKey, sValue, id, oType) (select title, cat_desc, cat_id, metadesc from jos_mt_cats where cat_id > '0'); update jos_mt_cats set title = 'introtext'; insert into uizb1_sobipro_language (sKey, sValue, id, oType) (select title, cat_desc, cat_id, metadesc from jos_mt_cats where cat_id > '0'); -- CHANGE CATEGORY SORT ORDER AND ADD A NEW CATEGORY MANUALLY THEY SHOULD BE SELECTABLE -- -- BEFORE YOU FINISH set uizb1_sobipro_language language field default value to blank --