Print

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:
copyraw
SET @CountCategoriesAlreadyEntered:=(SELECT MAX(term_id) FROM my_wordpress_db.wp_terms);

INSERT INTO my_wordpress_db.wp_terms
SELECT
	(a.id + @CountCategoriesAlreadyEntered) 'term_id',
	a.title 'name',
	a.alias 'slug',
	0 'term_group'
FROM
	my_joomla_db.jos_categories a
ORDER BY
	a.id;


INSERT INTO my_wordpress_db.wp_term_taxonomy
SELECT
	(a.id + @CountCategoriesAlreadyEntered) 'term_taxonomy_id',
	(a.id + @CountCategoriesAlreadyEntered) 'term_id',
	'category' AS 'taxonomy',
	a.description 'description',
	0 'parent',
	(SELECT COUNT(c.id) FROM my_joomla_db.jos_content c WHERE c.catid=a.id) 'count'
FROM
	my_joomla_db.jos_categories a
ORDER BY
	a.id;	


INSERT INTO my_wordpress_db.wp_term_relationships
SELECT
	b.id 'object_id',
	(b.catid + @CountCategoriesAlreadyEntered) 'term_taxonomy_id',
	0 'term_order'
FROM
	my_joomla_db.jos_content b
ORDER BY
	b.id;
  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 the joomla categories to Wordpress: (still to do: sections as parent categories?)

copyraw
...still to come...
  1.  ...still to come... 
Importing Joomla jComments to Wordpress Posts:

...still to come...
Category: Wordpress :: Article: 377