[module] Convert Joomla! 1.0 to Drupal 6

jcisio - April 22, 2008 - 08:34

Hello,

I writen this module to convert Joomla! 1.0 to Drupal 6. It does the following:
- Only support clean Drupal 6 installtion
- Keep all Joomla! contents, users. Keep content item id unchanged (for SEO for example)
- Remove comments marked as spam (support only Jom Comment)
- New vocabulary for section/category
- Support mosimage
- Support some other features that I'm using..

It isn't widely tested. Just test with Joomla! 1.0.12, 1.0.15, Drupal 6.0, 6.2 on my localhost and another host, 4000 articles + 1000 users + 3500 comments without any problem. Only tested with utf-8 encoding. Only tested with PHP 5, 32 MB memory.

It was supposed to support SOBI2, mosetTrees... but finally I think it doesn't worth coding. So I release it now. joomla2drupal is derived from http://joomla2drupal.teodorani.com/ (which doesn't support D6) which is based on http://www.borber.com/en/projects/wp2drupal (support D4.7 only).

[April 1st 2009] Ah luckily now I can edit this page. So I update the link. You don't have access to my SVN (sorry) but there is daily export archive of the module: http://svn.jcisio.net/d/joomla2drupal.tar.gz

jcisio.

Hello, I deploy some private

jcisio - May 26, 2008 - 17:05

Hello,

I deploy some private module with that svn, so no anonymous svn access now. For download, please use: http://svn.jcisio.net/d/joomla2drupal.tar.gz

BR,
jcisio

thank you!

DocMartin - June 1, 2008 - 13:39

Many thanks for this module!

I just used, after trying Joomla migrator component for 1.0.14 to 1.5. I'd already been thinking that may be best if could move to Drupal - but daunted by apparent difficulties - lots of faffing about with MySQL; when the Joomla migrator component gave me an error, had another look at info on migrating to Drupal, and found this nifty new module.

Just worked for me (once entered correct joomla database info!) - on a test, MAMP install on a Mac.
From database with mainly the default swedish (!) encoding, and with mos_ as prefix.

Impressive seeing all the free tags that have been generated - way too many perhaps, but can figure ways around this, if needs be; or may find that make for well cool tag cloud.
Users seem to be in without problem; already, deleted umpteen wannabe spammers who had signed up, and not so simply removed in Joomla.

Still got quite a bit to do, inc figuring how to get URLs the same as on my Joomla site (may just use manually created URLs; pathauto ones not quite the same - partly as w Joomla use the short item titles).
Also, importantly, want to sort Fireboard forum. Rather seems an approach could be to convert to SMF, and maybe use this via bridge; or move from SMF to phbb and thence Drupal [! - rather scares me, I must say, but may be worth it in the end]

One thing I'm looking forward to is using menalto Gallery properly. Later; for now, back to the test site. Fingers crossed this becomes good to go live.
____________________________
CheungChauHK 長洲HK - South China Sea island in Hong Kong (built w Drupal from the start)

I'm in the same boat as you...

gav240z - June 12, 2008 - 15:35

I want to move from Joomla site and SMF forum to Drupal.

All my users are registered in SMF as Joomla is only used for front page articles. I think the only downside with the SMF -> PHPBB -> Drupal will be that user passwords are not easily transferred and as a result users will need to use the reset password facility in Drupal.

I would be interested to hear how you get on, as I don't plan on making this migration for some time, but would like to eventually.

Let me make an suggestion:

ericinwisconsin - June 15, 2008 - 08:36

Let me make an suggestion: Keep SMF and use the SMFforum integration module to sync up your existing SMF site with Drupal. The integration works both ways, so you might lose some Joomla-specific user info, but from what you're saying, you didn't do much with the Joomla part of your site, as far as the user table is concerned.

Bridging got me into this mess...

gav240z - August 27, 2008 - 16:24

Yes but bridging got me into this mess in the first place. Ideally I want to migrate my users from my SMF / Coppermine bridge to Drupal. Migrating Joomla content would also be a bonus.

This way i can use 1 piece of software to manage what 3 pieces previously did. I've also read that the SMF / Drupal bridge has some issues.

I don't know if you still

tuaris - April 19, 2009 - 09:04

I don't know if you still need help, but maybe someone else will benefit from my post. I have written a script that can migrate Joomla Simple Boards to Drupal.

http://drupal.org/node/438124

It's released under the BSD license, so the author of this module is free to incorporate my work into this module.

President/CEO
Pacy World - The Daniel Morante Company, Inc.
http://www.pacyworld.com

Thanks a lot

richbaldwin - January 17, 2009 - 17:27

Great module. Migrated Joomla 1.0.13 to Drupal 6.8 no problem.
Oh yes, you have to change the following lines are per this comment:
http://drupal.org/node/249643#comment-1195313

I used this version:
http://svn.jcisio.net/d/joomla2drupal.tar.gz

from: for ($i=0; $i<$num['article']/1000; $i++) {
to:  for ($i=0; $i<$num['article']/100; $i++) {

and
  from:  for ($i=0; $i<$num['user']/1000; $i++) {
  to: for ($i=0; $i<$num['user']/100; $i++) {

and (didn't actually use this section myself)
from:     for ($i=0; $i<$num['comment']/10000; $i++) {
to:    for ($i=0; $i<$num['comment']/100; $i++) {

Very minor change. Once you make those changes ... perfect...

Thanks again.

conversion module

bhanu123 - June 10, 2008 - 06:02

.

converting a website from joomla2drupal

bhanu123 - June 3, 2008 - 13:36

I need a detailed explaination of how to migrate from joomla to drupal .
step by step procedure or any reference website ids are needed plz reply me

An explanation of sorts

DocMartin - June 7, 2008 - 05:01

I've just posted some info that may help, at:
http://drupal.org/node/80195#comment-873315

- but as indicated, I've taken rather cumbersome approach I believe, as about clueless re MySQL (and php).
Maybe can help a bit; even if partly for what not to do!
____________________________
CheungChauHK 長洲HK - South China Sea island in Hong Kong.

Lyumbatrancikle

kukinoz - June 19, 2008 - 02:32

Hi. It`s a good module and works fine! I`ve imported all of my contents to Drupal succesfully. But there are a little problem with it that it creates one and only vocabulary "Topics" and puts all sections and categories as terms. We`ll I guess you`re aware of it :-) I have about 50 sections/categories and 3600 articles. It`s a big mess managing such many entries in Drupal admin! ... I also tried out another module http://drupal.org/project/joomla - But I also have some problems with this too (I`ve just posted Issue here http://drupal.org/node/272268 ). This module does that what I need: correct copy of sections/categories structure. Is it possible to make some changes to your module also to do so instead of creating single vocabulary "Topics"?

p.s.didn`t expect that migrating will be such problematic! I`m in Joomla jale :-)

Download link is broken

bladiebla - June 29, 2008 - 13:04

I can't download the file.
Could someone upload it to a other server?

-edit- got it

re: Download link is broken

kollo-dherbois - June 30, 2008 - 03:52

Hi. It is not broken - hope you can see link in comment #1 here => http://drupal.org/node/249643#comment-829971 And it works. or just click here :-) => http://svn.jcisio.net/d/joomla2drupal.tar.gz

Thank you for your module. I

Bilalx - July 15, 2008 - 12:55

Thank you for your module. I tried it with mambo 4.5 and drupal 6.3. It works as expected with my encoding latin1_swedish_ci.

Now i just have to go back to the admin area to learn how to use Drupal :)

Hello, I plan to add some

jcisio - July 17, 2008 - 10:12

Hello,

I plan to add some more features, include SOBI2 -> CCK migration. I'll try it this weekend, but any ideas to export SOBI2 structure and import it into CCK are welcome, or just some place where there is explanation. Especially for CCK2 and Drupal 6, as tables structure has changed since then.

jcisio.

ideas re module

DocMartin - July 18, 2008 - 04:28

Hi jcisio:

Bit late for me, but a couple of things that may be worth a look as you aim to enhance the module:

I think better if create vocabularies for Joomla/Mambo sections, then have the category terms for categories.
Free tags from keywords in are good.

Maybe take article titles from mambo/joomla short page titles, or give option to do so. Were important for me, as I used in creating URLs w Joomla, and can use pathauto to create the same URLs in Drupal.
[Ideally, then, long titles to be used for the page title via page title module. Ideally! - I've no idea if this is real trouble to program]

Maybe can do something re links to images. Instead of to images/stories, maybe to /sites/files/www.example.com/files/images/ [no need for the stories folder] - this way, can browse images with IMCE, say.
Right now, I have images in both places; occasionally edit articles to amend links to images. Still haven't tried search n replace in mysql for these.

Hope plenty of people use the module, at least try Drupal for their sites; kudos for creating it! (and for revising, even tho seems you no longer need it)
____________________________
DocMartin and Hong Kong OutdoorsCheungChauHK 長洲HK

DocMartin, No, you was not

jcisio - April 1, 2009 - 10:04

DocMartin,

No, you was not late, I'm late ;)

For the vocab, I use only one, as an article can be placed in different sections (yes, possible with my Joomla! site).

For the images, it depends on site. For large sites, no one uses images/stories to bother with Joomla! stock images. The mosimage is different between 1.0 and 1.5 version of Joomla! (I don't use 1.5 so I'm not sure about other stuffs), so I leave it for user to customize. I remember that this converter takes care of mosimage ;-)

image storage

DocMartin - April 2, 2009 - 00:48

well, I'd used images/stories for storing images I added; didn't use mosimage, but added paths to images via Fckeditor. By leaving images/stories folder, these paths still work after change to Drupal - but images not in proper Drupal files folder.

Good that you're still answering qieries re the module - albeit after delay! - even though you have already done with using the module.

____________________________
DocMartin and Hong Kong Outdoors

Fatal error: Call to undefined function content_clear_type_cache

glaster - August 8, 2008 - 20:33

Hi,
I receive the following error message:
Fatal error: Call to undefined function content_clear_type_cache() in /modules/joomla2drupal/joomla2drupal.module on line 887
I am running drupal 6.3
Any ideas?

Please disable *gallery*

jcisio - August 12, 2008 - 10:07

Please disable *gallery* module when you convert.

The converter requires CCK (and a few other modules) to convert content types other than Joomla!'s content items.

Disabling all options error persist

glaster - August 12, 2008 - 16:45

Hi,
I tested several alternatives, disabling all options I still receive the error
Cannot redeclare db_status_report() (previously declared in (...edited)/includes/database.mysql.inc:20) in (...edited)/includes/database.mysqli.inc on line 39

Is there a list of all possible modules needed for it to work? I would not mind adding extra modules if I can do the import outside of SQL.
THANKS

I think your problem is that

jcisio - August 12, 2008 - 18:44

I think your problem is that Drupal doesn't support 2 different db engines (even you can use more than 1 db at the same time). In the error message I see that mysqli is used first, then mysql.

You might switch your Drupal db connection from mysqli to mysql and let my know if it works.

Edit: or from mysql to mysqli. I'll fix this bug soon.

Converting menu structure?

it_for_change - November 2, 2008 - 14:07

Hi there,

I have successfully used your module to import the content from a Joomla site into a Drupal site. My question: is there a way to keep the menu information generated in Joomla and bring this into menu_links in Drupal, or do we have to recreate the entire menu structure?

Thanks in advance for your help.

Hi it_for_change, No, it

jcisio - April 1, 2009 - 09:55

Hi it_for_change,

No, it doesn't convert the menu structure. I'll hardly keep the Joomla! menu after the migration!

Yikes! Why would you want to

greta_drupal - November 10, 2009 - 00:42

Yikes! Why would you want to keep that awful Joomla menu system.

User passwords

Shura80 - November 26, 2008 - 14:35

The module works, but there's a problem with the password due to the differences in encrypting methods between Joomla (from 1.0.13) and Drupal.

In fact Drupal only uses MD5 while Joomla now uses a function that generate the md5 of the password, appends to this a string of 16 random charcaters, re-encode this 48 characters (32 for MD5 + 16 for random string) and print the new encrypted md5 string plus the random string in the users table of the database.

Something like xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxx

So the first 32 charaters before ":" are not the simple md5 of the password given by the user.

The only thing to do is request a new password.

:)

Only converts first 100 users and articles

trampgeek - January 12, 2009 - 08:12

Hi jcsio

Thanks for making this available -- it was very helpful in getting me going. However, in the current version of the code it only converts the first 100 users and first 100 content items. Fix is very easy -- in joomla2drupal.module lines 288 and 293, the divisors should be 100 not 1000, since you do 100 items at a time.

-- trampgeek

Hacked community builder profiles

ac00perw - January 23, 2009 - 17:34

I hacked the module to accept community builder profile fields as such:

1. Add your custom fields to the profile fields section:

<?php
// Create profile fields
   
$query = "INSERT INTO {profile_fields} (fid, title, name, explanation, category, page, type, weight, required, register, visibility, autocomplete, options) VALUES (%d, '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, '%s')";
   
db_query($query, 1, 'Fullname', 'profile_fullname', 'Your fullname', 'Personal information', '', 'textfield', 0, 0, 0, 2, 0, '');
   
db_query($query, 2, 'Address', 'profile_address', 'Your Address', 'Personal information', '', 'textfield', 1, 0, 0, 2, 0, '');
   
db_query($query, 3, 'City', 'profile_city', 'Your City', 'Personal information', '', 'textfield', 2, 0, 0, 2, 0, '');
   
db_query($query, 4, 'State', 'profile_state', 'Your State', 'Personal information', '', 'textfield', 3, 0, 0, 2, 0, '');
   
db_query($query, 5, 'Postal Code', 'profile_postalcode', 'Your Postal Code', 'Personal information', '', 'textfield', 4, 0, 0, 2, 0, '');
   
db_query($query, 6, 'Phone', 'profile_phone', 'Your Phone', 'Personal information', '', 'textfield', 5, 0, 0, 2, 0, '');
?>

2. Change the query in the import_users function:

<?php
$result
= db_query_range("SELECT u.*, c.cb_streetaddress as address, c.cb_state as state, c.cb_zip as zip, c.cb_phone as phone FROM %susers u, jos_comprofiler c where c.id=u.id ORDER BY u.id", $_joomla2drupal_vars['config']['Joomla']['db_prefix'], $start, 100);
?>

3. Insert the Community Builder profile fields into profile_values:

<?php
db_query
("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 1, $created_user->uid, $user['name']);
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 2, $created_user->uid, $user['address']);
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 3, $created_user->uid, $user['city']);
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 4, $created_user->uid, $user['state']);
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 5, $created_user->uid, $user['zip']);
db_query("INSERT INTO {profile_values} (fid, uid, value) VALUES (%d, %d, '%s')", 6, $created_user->uid, $user['phone']);
?>

4. Yeah, it's a little ugly, but you'll only be using this module once, eh? Sweep the dirt under the rug.

only 100 articles

enjoy777 - January 27, 2009 - 21:32

hello

I tried to use this module to convert my joomla articles to drupal, but I have problem.
This module only migrates 100 first records from joomla content table and in drupal node table I can see only 100 migrated articles.
So how can I change it? I do it on my local server so maybe it is a problem with a local server. But I don't know how and what to change in the code or config files

Any idea?

I was testing the migration

jcisio - April 1, 2009 - 09:52

I was testing the migration so I limited this. However it's easy to fix, cf. previous comments. Or download the latest version (hope it works, I didn't test!)

Now I'm into the customisation part and I try not to touch this module, so that it works for you. Use this for a base only.

Regards,

costum insertion node

t3ns41 - February 11, 2009 - 06:30

hi jisio, thanks for this module i already import from joomla with content over 20.000 article and it work great. i change the code so i can import all article. i successfully import all the article but i got problem when import comment, it doesnt insert in table comment. in my joomla database the comment is over 90000 rows. when import article to my drupal it's take 8 hours to complete the import.

i think it would be better for someone that under development sites using drupal like me, if the module that can import data or without truncate the table and rewrite existing data, i think it will reduce time if i want to import newest article in my joomla database. because when under migration to drupal, user from my joomla insert article over 50 article a day. if user can only import the newest article i think it will help someone and it will less consumtion time.

thanx... for this module...:D

Hi t3ns41, That's one of

jcisio - April 1, 2009 - 09:49

Hi t3ns41,

That's one of ideas when I developed this module. However, it needs more time to implement (you must however get all the user info, sync their ID... then check when to start). An easy fix is that you remove the truncation code, when importing content, check if that ID exists.

About the migration, I'd make my Joomla! in "archive mode" for one day, do the conversion, then close Joomla! site, open Drupal's one!

DB access

greta_drupal - February 25, 2009 - 01:56

Is there anyway to use a SQL dump file for the conversion rather than having to put in Joomla site db access info?

I got the clear cache function error (noted by someone else) when I did try with db connection. But, I would prefer to run a conversion without involving the live Joomla site.

I can build the theme, menus, and users (there are only 6) from scratch in Drupal, but there is a lot of content in Joomla.

You can import your dump file

jcisio - April 1, 2009 - 09:38

You can import your dump file into the same Drupal db (with different prefix), then run the conversion.

Thank You!

ddwornik - April 6, 2009 - 21:51

This worked so well i can't believe it.

A very sincere thank you.

Subscribing!!

aac - April 19, 2009 - 09:12

Subscribing!!

Thank You!!

onion - May 21, 2009 - 20:23

You just saved me a few weeks and several millimeters off my teeth!!

Hi jcisio, First of all I'd

malclocke - June 3, 2009 - 09:56

Hi jcisio,

First of all I'd like to thank you for all your work on this module. It will save myself and many others a huge headache.

Are you still actively developing this module? If so, would you consider setting up the module as an official drupal.org contrib module? I plan on adding some features to this module and this would make it easy to share this work with others. If you do not have time or interest in doing this, would you mind if I did? I would of course give you full credit as the module creator.

Thanks,

Malc

Thanks!

Keiichi - June 5, 2009 - 03:01

I have successfully migrated from Joomla 1.5.7 to Drupal 6.12! I did have to extend my PHP memory limit due to an error that occured during the process, but this was a minor php.ini/.htaccess fix.

Thanks a ton! This really cured my headache.

Hi malclocke, This module is

jcisio - July 2, 2009 - 06:49

Hi malclocke,

This module is now in the freeze period and I don't think I will add any features in it. So if you want to develope, you are welcome to create a contrib module on it. Let me know if you (or drupal.org) need the SVN repository, too.

Best regards,
jcisio

status update

sleepcamel - July 8, 2009 - 15:55

Malc,

Since you seem to have your hands in both, could you comment on the status of this module as well the "Joomla to Drupal" module at
http://drupal.org/project/joomla ? Are you still planning to add this module to Contrib and add features to it, or are you integrating the two modules?

I'm sure I'm not the only one who isn't sure which option to go with, but my preference is certainly to work inside of Contrib so I can share any bugs or improvements.

Once you've clarified, maybe we should ask the OP to update the original post, too, so it doesn't get lost in the comments.

Thx,
Brad

First up, thanks jcisio but I

malclocke - July 9, 2009 - 02:44

First up, thanks jcisio but I have already started working on the joomla project in contrib as I had fairly urgent time pressure to start working for my client and the fact that the other module was a contrib project swayed it. I will probably integrate the best parts of joomla2drupal into this module (with full credit given to jcisio of course) as I don't think it will benefit anyone to have two different modules in contrib doing this.

Brad,

Yes I am very actively working on this module. I will update the project page with planned features in the next few days, but briefly I am planning the following:

  • Port to D6 - Done
  • Allow users to log in with Joomla passwords - Done
  • Support connection to remote database - Done, code based on that from joomla2drupal
  • Allow mapping of Joomla sections / categories to content types
  • Allow rolling imports via cron, e.g. keep Drupal site synchronised with Joomla.
  • Redirect old Joomla URLs to Drupal ones
  • Some other bits'n'bobs ...

So if you are planning on a Joomla 1.0.x migration to Drupal 6 I would recommend you keep an eye on http://drupal.org/project/joomla for an alpha release over the next couple of weeks.

Thanks

Haemathemesis - September 7, 2009 - 08:40

edited.

 
 

Drupal is a registered trademark of Dries Buytaert.