How To Migrate Joomla Content (Articles) Using phpMyAdmin

Want to support HowtoForge? Become a subscriber!
 
Submitted by SamTzu (Contact Author) (Forums) on Wed, 2011-08-24 11:37. :: Linux | Web Server | MySQL

How To Migrate Joomla Content (Articles) Using phpMyAdmin

Joomla is a very popular Content Management System (CMS). This article applies to Joomla 1.5 content (Article) migration to Joomla 1.7 using phpMyAdmin database tool.

 

How to Export Article Content on the old Joomla 1.5 site?

  • Login to phpMyAdmin database tool on the old site. (Database account settings can be found on Joomla configuration.php file.)
  • Select the correct website database from the left hand menu. (Do not enter or select any tables.)
  • Select the SQL tab on the top menu.
  • Check the Table prefix's are jos_ (default in J1.5) and then run this query. (Copy paste and Go.)

## CHECK THE TABLE PREFIX!!! ie. jos_content or j15_content or what-ever_content.

SELECT `title`, `alias`, `title_alias`, `introtext`, `fulltext`, `state`, `sectionid`, `mask`, `catid`, `created`, `created_by`, `created_by_alias`, `modified`, `modified_by`, `checked_out`, `checked_out_time`, `publish_up`, `publish_down`, `images`, `urls`, `attribs`, `version`, `parentid`, `ordering`, `metakey`, `metadesc`, `access`, `hits`, `metadata` FROM jos_content

  • After the query results are displayed press the Export button on the bottom of the page. (Use "Show" option to make sure you export all the lines. There might be many pages.)
  • You should now see the query on top of the page and options below it. (You can still edit the query before exporting it.)

Your SQL query has been executed successfully.

## CHECK THE TABLE PREFIX!!! ie. jos_content or j15_content or what-ever_content.

SELECT `title` , `alias` , `title_alias` , `introtext` , `fulltext` , `state` , `sectionid` , `mask` , `catid` , `created` , `created_by` , `created_by_alias` , `modified` , `modified_by` , `checked_out` , `checked_out_time` , `publish_up` , `publish_down` , `images` , `urls` , `attribs` , `version` , `parentid` , `ordering` , `metakey` , `metadesc` , `access` , `hits` , `metadata` FROM jos_content

  • Add "CREATE PROCEDURE / FUNCTION / EVENT" option.
  • Unmark "Save as file" option.
  • Press Go on the bottom right.
  • After the Export has finished copy the data.

 

How to import Article Content on the new Joomla 1.7 site?

  • Login to phpMyAdmin database tool on the new site.
  • Select the correct website database from the left hand menu. (Do not enter or select any tables.)
  • Select the SQL tab on the top menu.
  • Paste the data as a new query.
  • Press Go.

If you did not receive any error messages, your old articles should now be imported to the new Joomla 1.7 site. If you failed it is most likely that you need to check and possibly alter the table prefix's. The easiest way to do this is with some simple text editors "Find & Replace" function. Replace jos_ to new_j17-prefix_.

You still need to assign the articles to proper categories and link the menus.

Sami Mattila
Internet-Content


Telephone:
+358.9.42833310
Email: firstname.lastname@internet-content.org
Shop: https://shop.internet-content.net
Site: http://www.internet-content.net
Blog: http://www.internet-content.net/en/blog

Social:IC Facebook IC Linkedin IC Blog RSS IC WordPress

Please do not use the comment function to ask for help! If you need help, please use our forum.
Comments will be published after administrator approval.
Submitted by Anonymous (not registered) on Sat, 2011-10-29 18:48.

Hi,

 that's nice and worked well,but without the categories!!

is there a way hot to add the categories??

 Avi

Submitted by It Managed Services (not registered) on Wed, 2011-10-12 12:24.
Superb article ,I really appreciated with it, This is nice to read and valuable for future,I really 
bookmark it, for further read. Thanks for sharing. I like it.
Submitted by Guzabi (not registered) on Fri, 2011-10-28 11:49.

I'm sorry to say that this will break Joomla 1.7 content management Simply transferring data from one table to the other *will* break things. Four examples :

 - The column 'asset_id' is the main problem : it's a link to a foreing key on the #__assets table. You have to create a record in the #__assets table for each record in the #__content table, and insert correct id's to link them.

 - 'sectionid' is not used in 1.7 due to the new way categories work. It should be always set to zero.

- 'catid' will OF COURSE be different in your new db, so you have to update it (and be careful doing it!) and to do that you need to have already created your categories (and taken note of the category id matching) and transform everything before re-insterting.

- 'created_by' and 'created_by_alias' are exactly the same : new website, new ID's for your users, you first need to re-create them, then change the ID's accordingly in your data before re-inserting. 

There are other details I don't have time to discuss. Anyway, writing what you wrote is completely unproductive. I'm sorry to say that this article is not only not useful, but it's also dangerous. 

Submitted by Amol Patil (not registered) on Thu, 2012-01-19 07:19.
Yes you are absolutely correct.. Its not the write way to copy articles in Joomla 1.7 
Submitted by Andy (not registered) on Fri, 2013-06-14 16:19.
Since the 1.7 version is not really 'in trend" now, I moved my posts (and the rest of content) to Joomla 2.5 via CMS2CMS . I am not the savviest person in the world, and lest I should break anything, referred to this online converter.

It worked fine, and I basically had my content copied to the new installation, and nothing happened. I just had all URLs redirected to new ones - and that's it.