Import articles to Joomla!
(Postnuke-Nuke raw example)

This is a very raw (working) test/script that use Php and MySQL to extract Postnuke/Nuke articles content from a database (look queries schema to fit yours) and import these data on another Joomla! db, installed on same server.

The script use ezSQL library to connect/interact with database.

NOTE: this script can be coded much better (queries and functions can be reduced, but as said, it is a raw script). By the way it work also as is, and it can be adapted to import articles on Joomla! 3> from any other CMS with a modification to few instructions.

NOTE: this script suppose that on Joomla! database exist same Categories named as on Postnuke database.
So it is necessary to create the same Categories in Joomla! named as are on Nuke/Postnuke.
I will not post this part of code as it do not respect, and corrupt, the joomla! assets table on inserting categories form Nuke/Postnuke. I had use it for many categories to insert, but using after a further tip to rebuild the joomla asset, and i never had adjust it.

NOTE: on INSERT queries: many values have been set as vars with a default value, like $asset_rules for the column rules. Some other queries values instead, like column created_by have been set ‘inline’ (as in the example user with id 734 as default for all inserted articles on column created_by).

More about Joomla! asset also at Joomla! documentation: Fixing the Joomla! assets table.

import articles to Joomla! code:

SQL Trees and Hierarchies:
SQL Trees and Hierarchies

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.