Every day, there’re so many people choosing WordPress as their CMS that replacing Joomla as the system on their website. And It would be a disaster if you already have content in your joomla website, but you need to install wordpress at the end.

There’s a way to input all the joomla content into wordpress content, the tutorial below, will let you know how.

First adjust the config.php and upload all files to your webserver.

/*
* Configuration for your Database and stuff
*/

$SQL['HOST'] = “sql.lan”;   // Normaly localhost
$SQL['USR'] = “DBUser”;
$SQL['PWD'] = “12345678″;

// Joomla realted ->
$SQL['JOOMLA_DB'] = “solariz_de”; // Database name of Joomla
$SQL['JOOMLA_PRE'] = “jos_”;    // Table Prefix of Joomla Tables

// WordPress realted ->
$SQL['WP_DB'] = “solariz_wp”; // Database name of WordPress
$SQL['WP_PRE'] = “wp_”;       // Table Prefix of WordPress Tables

$DEFAULTS['POST_AUTHOR']   = 1; // User ID of target Author (1 usualy admin)
$DEFAULTS['POST_CATEGORY'] = 5; // I suggest to create a category named e.g. Import

The possibilities for adaptation are indicated by the comments. It is important that POST_AUTHOR and POST_CATEGORY ID`s in WordPress exist. So first create a blank WordPress installation. Ideally, without any content so there won’t be any conflict. Now create a category and a user and put in their ID`s in the config.php of the converter. For example user ID 1 (usually admin) and a category called “Import” with the ID 5.

The converter finds all the Joomla Article belonging to this category. If you have many categories in Joomla you can limit the using query in index.php to select just certain articles of a specific category, and then you can run the script once for each category.

In index.php at line #46, you can find the responsible query to read the articles:

// WHERE `sectionid`=’1′
$query = “SELECT * FROM `”.$SQL['JOOMLA_PRE'].”content` ORDER BY `created`”;

Here you can, as mentioned above, add a WHERE statement to limit the selecting articles.

WordPress uses multiple tables in order to save the entries. In order to avoid a conflict, you should ensure that all articles in the target WP installation are previously deleted.

The Conversion
After you adjust the script to your settings, you can run index.php.

del.icio.us Digg Facebook Google Google Reader Newsgator Technorati