Drupal-Joomla Forum Importator


Drupal-Joomla Forum Importator



About

This is a PHP script to help you migrate forums from Joomla Simple Board to Drupal Forums. This script uses concepts and methods described in the Drupal Help Files located on this site.

Requirements

  • Tested on PHP 5.2.x
  • Tested on Apache 2.x
  • Tested on Drupal 6.x
  • Forums module must be activated
  • Comments module must be activated
  • You must already have Joomla users migrated (See: http://drupal.org/node/249643)
  • You must have read permissions to the Joomla DB

Getting Started

Extract and upload all the files to to your web server that is hosting the Drupal Installation you'd like to migrate to. In this example, Drupal is located in "/usr/www/data/mywebsite/drupal". We will upload them to "/usr/www/data/mywebsite/importator".

It's critical that you first enable the forums and comments modules. Do this by logging in as an administrator and go to the modules area and enable them. Secondly, you must already have your Joomla users imported. Take a look at the Joomla Converter module for Drupal located here: http://drupal.org/node/249643.

Once you have that stuff taken care of, open up "config.php" and edit as needed.

<?php
define
("IMPORTATOR_DRUPAL_DIR", "../drupal");
define("JOOMLA_DB_NAME", "joomla_dev");
define("JOOMLA_DB_USER", "root");
define("JOOMLA_DB_PASS", "");
define("JOOMLA_DB_HOST", "localhost");

//Decide whether or not to actually write data.
$TEST = false;
?>
  • IMPORTATOR_DRUPAL_DIR: The directory in which the Drupal installation resides, can be relative to the import script or absolute
  • JOOMLA_DB_NAME: Joomla Database Name.
  • JOOMLA_DB_USER: Joomla Database User that has complete read access.
  • JOOMLA_DB_PASS:Joomla Database Password.
  • JOOMLA_DB_HOST: Joomla Database Host, usually localhost, but it can be a remote database as long as you have correct permissions setup.
  • $TEST : Allows you to test you settings before doing any actual modifications. (You may see errors if you change this to "true".)

Save the config.php file.

Backup Your Drupal Database!

Although much testing has going into making this script, their is a chance that this import script will destroy your Drupal database. Backup your Drupal database.

Let it Begin

Open up the web browser (Firefox is recommended) and navigate to where you uploaded the script. For example, http://www.unibia.org/importator. The import process will begin. First it will create a new container then the forums inside that container. After that it will attempt to migrate the forum topics. Finally, it will copy over the topic replies/threads.

You backed up your database? Right?

If all goes well, you'll see:
IMPORTATION COMPLETE!

Advanced Usage

The "index.php" script will automatically execute the needed steps in order. However, you can also run each step individually.

  • importForums.php: This create a unique named forum container and migrates the Joomla Simple Board categories. Drupal treats these and Vocabulary and Terms.
  • importTopics.php: Migrates the Joomla Simple Board top level messages, aka Forum Topics. Drupal treats these as Nodes
  • importReplies.php: Migrates the Joomla Simple Board child messages, aka Forum Replies. Drupal stores these as Node Comments

This script will not duplicate data. So you can re-run the script or any part of the script as much as you'd like. Running the components out of order will produce unknown results, so do so at your own risk.

Additionally, this script will convert PHPBB code that is used in Joomla Simple Board into standard HTML. It will also try to convert non-HTML characters into their HTML code equivalents.

Known Issues

Since this script will prevent it's self from creating duplicate data, In rare instances this may cause certain topics to be lost/merged during migration if the Joomla topics have the same EXACT subject. In the even more rare instance, comments might suffer this same issue. In a way this is probably a good thing.

Another issue may be with text encoding and special non-HTML characters. This script may have some trouble migrating topics or replies with strange/exotic characters. The result will be truncated bodies and it will possibly be duplicated (if it has replies). If you run into this, you need to find out what character is causing the problem, find it's HTML equivalent and let me know.

In the instance where a topic/reply can't get matched up with an author/creator, this script will fall back to the first user (uid = 1).

Lastly, if you have a very large forum to migrate, you might need to give PHP more memory (in the php.ini file). The amount of memory you need depends of how big the forums are. If you run out of memory, the script will crash. If this happens, close you browser, edit your php.ini, reload your webserver and try again. The script will skip over the items that where already imported.

Where to get it

Download it at: http://www.unibia.com/unibia/dev/downloads/Drupal-JoomlaForumImportator.tar

Comments

Thanks for helping people to

Thanks for helping people to understand that Microsoft will do anything in an attempt to keep their market share. They were unethical in their rise to the top, obviously they will continue to be unethical as they try to fight off competitors. Example; Windows Vista was a turd, but that didn't stop Microsoft from attempting to sell it to us. Windows 7 is Vista, only polished up a bit - will you buy it now? .NET is a turd. Silverlight is a turd. Microsoft will polish these products until they appear to glisten but keep in mind... no matter how much you polish a turd, it

This is the sort of thing i'm

This is the sort of thing i'm talking about with Drupal. Sure the learning curve is steep at times but its power is amazing and i've never got to the "Oh you just can't do that" stage at all. Its more of a "Now whats the best way to do that" implementation.

I think Drupal gets bad press sometimes from new members (myself included in that statement) and i just wanted the people that work hard on the system, in whatever format they do to help, to know that the positives far outweight the negatives and efforts are appreciated.

question on importing users

I run an intranet and the forum that I'm migrating has employees no longer with the organization. I'd prefer not to migrate their user accounts over to Drupal. Will this Importator crap out if there aren't users for every posting and comment?

RE: question on importing users

No, the posts and comments will be assigned to the default user (ID = 1).

Pacy
Powered by Pacy