     )
 select 
     post_ID as id,
-    1 AS author_id,
-    post_urltitle AS slug,
-    post_title AS title,
-    IF(itpr_content_prerendered IS NOT NULL,itpr_content_prerendered,post_content) as content,
-    "html" AS markup_type,
-    IF(cat_blog_ID=5,"en","jp") AS locale,
-    "" AS tags,
-    IF(post_status="published",1,0) AS active,
-    post_datestart AS pub_date,
-    post_datecreated AS create_date 
+    1 as author_id,
+    if(post_urltitle is not null and post_urltitle != '', post_urltitle, concat('p', post_ID)) as slug,
+    post_title as title,
+    if(itpr_content_prerendered is not null,itpr_content_prerendered,post_content) as content,
+    "html" as markup_type,
+    if(cat_blog_ID=5,"en","jp") as locale,
+    "" as tags,
+    if(post_status="published",1,0) as active,
+    post_datestart as pub_date,
+    post_datecreated as create_date 
 from ianlewis_b2evo.evo_items__item
-    LEFT JOIN ianlewis_b2evo.evo_categories 
-        ON post_main_cat_ID = cat_ID
-    LEFT OUTER JOIN ianlewis_b2evo.evo_items__prerendering
-        ON post_ID = itpr_itm_ID AND itpr_format = "htmlbody"
-WHERE cat_blog_ID = 5 OR cat_blog_ID = 14;
+    left join ianlewis_b2evo.evo_categories 
+        on post_main_cat_ID = cat_ID
+    left outer join ianlewis_b2evo.evo_items__prerendering
+        on post_ID = itpr_itm_ID and itpr_format = "htmlbody"
+where cat_blog_ID = 5 or cat_blog_ID = 14;
 
 insert into ianlewis.tagging_tag
     (

INSERT INTO ianlewis.blog_post 
    (
     id,
     author_id,

    )
select
    tag_ID,
    LOWER(tag_name)
from ianlewis_b2evo.evo_items__tag;

insert into ianlewis.tagging_taggeditem
