Hi Everyone,
I need to convert a Wordpress site into a Joomla site and I'm having trouble getting a query to work properly.
Right now I'm able to import the post and the categories form Wordpress into Joomla but what happen is that whenever I import the posts they lose the link with the category with they belong so a post that used to be in the category "Social Media" has now no category at all. So all my imported posts have no category in Joomla.
I think I know where I'm having the problem but I don't know how to solve it.
So here is what I think the problem is.
In the Wordpress database, the category is linked with the post ID but since we can assign multiple categories to a post it has a relation many to many and it has two other tables between wp_terms (categories) and wp_posts (posts) which are wp_term_relationships and wp_term_taxonomy.
So here is how they are linked.
Table
wp_posts, field ID has a relation 1 to many with table
wp_term_relationships field object_id and field term_taxonomy_id has a relation 1 to may with table
wp_term_taxonomy field term_taxonomy_id and finally field term_id has a relation 1 to many with table
wp_terms field term_id.
You can find the database structure here:
http://codex.wordpress.org/images/8/83/WP_27_dbsERD.png
What I need to do is select all fields from table
wp_posts and the term_id from table
wp_terms that is related to this post, like this when I import the posts they have a category assigned.
Does anyone know how to create a query that would allow me to do that?
Thank you very much in advance for your precious help.