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

Credit where Credit is Due:


Feel free to copy, redistribute and share this information. All that we ask is that you attribute credit and possibly even a link back to this website as it really helps in our search engine rankings.

Disclaimer: The information on this website is provided without warranty and any content is merely the opinion of the author. Please try to test in development environments prior to adapting them to your production environments. The articles are written in good faith and, at the time of print, are working examples used in a commercial setting.

Thank you for visiting and, as always, we hope this website was of some use to you!

Kind Regards,

Joel Lipman
www.joellipman.com

Related Articles

Joes Revolver Map

Accreditation

Badge - Certified Zoho Creator Associate
Badge - Certified Zoho Creator Associate

Donate & Support

If you like my content, and would like to support this sharing site, feel free to donate using a method below:

Paypal:
Donate to Joel Lipman via PayPal

Bitcoin:
Donate to Joel Lipman with Bitcoin - Valid till 8 May 2022 3QnhmaBX7LQSRsC9hh6Je9rGQKEGNQNfPb
© 2021 Joel Lipman .com. All Rights Reserved.