Tuesday, October 21, 2014
   
Text Size
Login

Importing Joomla articles to WordPress posts

Migrating the articles:
  1. Change database name my_joomla_db to your joomla database and my_wordpress_db to your Wordpress database
  2. Change http://demo.joellipman.com/wordpress/ to the full URL of your WordPress site.
  3. If post_type is to be post then append with ?p= otherwise use ?page_id=.
Articles:

  1.  ------ MIGRATING JOOMLA v1.5.# CONTENT TO WORDPRESS v3.2.# ------ 
  2.  ----------------------------------------------------------------- 
  3.   
  4.  INSERT INTO my_wordpress_db.wp_posts 
  5.  SELECT 
  6.       id 'ID'
  7.       1 'post_author'
  8.       created 'post_date'
  9.       created 'post_date_gmt'
  10.       CONCAT(introtext, ' '`fulltext`'post_content'
  11.       title 'post_title'
  12.       '' post_excerpt, 
  13.       CASE state WHEN '1' THEN 'publish' ELSE 'draft' END 'post_status'
  14.       'open' comment_status, 
  15.       'open' ping_status, 
  16.       '' post_password, 
  17.       alias 'post_name'
  18.       '' to_ping, 
  19.       '' pinged, 
  20.       modified 'post_modified'
  21.       modified 'post_modified_gmt'
  22.       '' post_content_filtered, 
  23.       '0' post_parent, 
  24.       CONCAT('http://demo.joellipman.com/wordpress/''?p=', id) AS guid, 
  25.       '0' menu_order, 
  26.       'post' AS 'post_type'
  27.       '' post_mime_type, 
  28.       0 comment_count 
  29.  FROM 
  30.       my_joomla_db.jos_content 
  31.  ORDER BY 
  32.       id 


Importing the joomla categories to Wordpress: (still to do: sections as parent categories?)


  1.  SET @CountCategoriesAlreadyEntered:=(SELECT MAX(term_id) FROM my_wordpress_db.wp_terms); 
  2.   
  3.  INSERT INTO my_wordpress_db.wp_terms 
  4.  SELECT 
  5.       (a.id + @CountCategoriesAlreadyEntered'term_id'
  6.       a.title 'name'
  7.       a.alias 'slug'
  8.       0 'term_group' 
  9.  FROM 
  10.       my_joomla_db.jos_categories a 
  11.  ORDER BY 
  12.       a.id; 
  13.   
  14.   
  15.  INSERT INTO my_wordpress_db.wp_term_taxonomy 
  16.  SELECT 
  17.       (a.id + @CountCategoriesAlreadyEntered'term_taxonomy_id'
  18.       (a.id + @CountCategoriesAlreadyEntered'term_id'
  19.       'category' AS 'taxonomy'
  20.       a.description 'description'
  21.       0 'parent'
  22.       (SELECT COUNT(c.id) FROM my_joomla_db.jos_content c WHERE c.catid=a.id) 'count' 
  23.  FROM 
  24.       my_joomla_db.jos_categories a 
  25.  ORDER BY 
  26.       a.id;      
  27.   
  28.   
  29.  INSERT INTO my_wordpress_db.wp_term_relationships 
  30.  SELECT 
  31.       b.id 'object_id'
  32.       (b.catid + @CountCategoriesAlreadyEntered'term_taxonomy_id'
  33.       0 'term_order' 
  34.  FROM 
  35.       my_joomla_db.jos_content b 
  36.  ORDER BY 
  37.       b.id; 
Importing Joomla jComments to Wordpress Posts:


  1.  ...still to come... 

Comments   

Mike W
# Mike Thu, 16th August 2012
Sorry for being a bit dim.

Will this work for a 2.5?

If so, how do I use it?

Cheers,

Mike
Like | Dislike | 0 Reply | Reply with quote | Quote
# Webmaster Mon, 20th August 2012
Hi Mike,

Sorry, this only works for Joomla 1.5.x to Wordpress v3.2+. I did it for someone a while back (a year ago) but it would only need a few tweaks. It's a bunch of database commands and you would need a MySQL administration tool or something like PhpMyAdmin installed on the same server as your website. As it has been a year, I'm a little unfamiliar with it but there can't be too many changes...

Joe
Like | Dislike | 0 Reply | Reply with quote | Quote
Add Comment

Name:

Email:

Website:

Message:


Latest Posts

  • Convert to Proper Case in T-SQL

    • Tue 07-Oct-14
      Really comprehensive function. Nice work! Dave.
      starsky51
  • Joes Quicklist Weblinks (JQW)

    • Wed 08-Oct-14
      Thanks jazzmang! This module is due for an update so I'll review this issue in the next version.
      Webmaster  
    • Tue 07-Oct-14
      I've set "Display Images" under Module Settings but the modules continues to display a hard coded CSS ...
      jazzmang
  • Joes Word Cloud (JWC)

    • Thu 16-Oct-14
      hello i use your tag cloud component in my joomla 2.5 website. i'm french and there is probleme with ...
      plykite2010  
    • Tue 07-Oct-14
      Hello, i have Joomla 2.5.27 and Module JWC v3.2.2 installed. In Configuration i fill in how many Word ...
      Maic