Advertisement
meetsos

Joomla to WordPress

Mar 11th, 2016
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 1.30 KB | None | 0 0
  1. ------ MIGRATING JOOMLA v1.5.# CONTENT TO WORDPRESS v3.2.# ------
  2. ------ http://www.joellipman.com/articles/web-development/wordpress/importing-joomla-articles-to-wordpress-posts.html ------
  3.  
  4. ------------ POSTS ------------
  5.  INSERT INTO my_wordpress_db.wp_posts
  6.  SELECT
  7.  id 'ID',
  8.  1 'post_author',
  9.  created 'post_date',
  10.  created 'post_date_gmt',
  11.  CONCAT(introtext, ' ', `fulltext`) 'post_content',
  12.  title 'post_title',
  13.  '' post_excerpt,
  14.  CASE state WHEN '1' THEN 'publish' ELSE 'draft' END 'post_status',
  15.  'open' comment_status,
  16.  'open' ping_status,
  17.  '' post_password,
  18.  alias 'post_name',
  19.  '' to_ping,
  20.  '' pinged,
  21.  modified 'post_modified',
  22.  modified 'post_modified_gmt',
  23.  '' post_content_filtered,
  24.  '0' post_parent,
  25.  CONCAT('http://demo.joellipman.com/wordpress/', '?p=', id) AS guid,
  26.  '0' menu_order,
  27.  'post' AS 'post_type',
  28.  '' post_mime_type,
  29.  0 comment_count
  30.  FROM
  31.  my_joomla_db.jos_content
  32.  ORDER BY
  33.  id
  34.  
  35. ----------- CATEGORIES ----------------
  36. SET @CountCategoriesAlreadyEntered:=(SELECT MAX(term_id) FROM my_wordpress_db.wp_terms);
  37.  
  38.  INSERT INTO my_wordpress_db.wp_terms
  39.  SELECT
  40.  (a.id + @CountCategoriesAlreadyEntered) 'term_id',
  41.  a.title 'name',
  42.  a.alias 'slug',
  43.  0 'term_group'
  44.  FROM
  45.  my_joomla_db.jos_categories a
  46.  ORDER BY
  47.  a.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement