You are here

PHPNuke To Drupal Migration

While porting this site from Nuke (7.1) to Drupal (4.6.0 final), I had to create a custom script to get the job done. I'm making this available to the Drupal community as there is no other solution available (afaik) at present to accomplish this. This isn't necessarily a pretty solution, just a functional one ;)

The download link is further below this page (change the extension to .php before you run it).

Thus far the migration has been smooth, and I've noticed no issues. The only anomaly that I've come across is due to Drupal's inconsistency when it comes to using the auto_increment feature. But this shouldn't affect the site in any manner.

If you find this script useful, and would like to give back something in return, I recommend donating to the Drupal project.

Please feel free to add your comments on this page for the benefit of other users.

I have no issues with reusing / posting this script elsewhere, but I'd appreciate it if you always give credit and link back to this page. Please do not link directly to the attachment on this server, and link to this page instead.

The following updates to this script are also available. I have not tested any of them.. so caveat emptor and all that..

From the comments: jonhattan has created a module to handle this migration using Drupal's Batch API.

Cheers,
-K
Edits:

  • July 2005: Reattached the file as a ZIP file. The source file inside has a .phps extension which will need to be renamed to .php. The attachment below is only visible to authenticated users.
  • August 2006: Added updates list.
  • February 2007 License confirmation: This script is licensed under version 2 of the GPL.
  • February 2007 Added link to Waldo's update.
AttachmentSize
Package icon nuke2drupal_migrate.zip6.15 KB

Comments

Hi Waldo,

I have gotten to the point of migrating my users, but I get the following message:

Transferring User Details to Drupal..
INSERT into missionj_drupal.users(uid, name, pass, mail, created, access, status, init, data) SELECT @a:= 1 + 1 + user_id, username, user_password, user_email, UNIX_TIMESTAMP(STR_TO_DATE(user_regdate, '%b %d, %Y')), user_lastvisit, 1, user_email, 'a:1:{s:5:"roles";a:1:{i:0;s:1:"2";}}' FROM missionj_nuke.nuke_users WHERE 1=1 AND username != 'anonymous' AND username != 'gfletcher'
Users could not be added.

...and can't get any further. I saw one prior comment that someone had this same issue, but the solution was not posted. Can you give me any suggestions, please? Thanks!

Greg

hi!
i'm running nuke 7.6 and the site has a photo gallery, based on the old coppermine stuff..
is this possible to migrate them as well as the picture comments?
other thing is the bbtonuke.. can i migrate it easily?
thanks for your help!

Hi.
I am trying to use this migrate script, but i have one problem. User migration works ok, but when i am trying to migrate stories, script show this error -
"Migrating story Categories: MySQL Error: Max ID for vocabulary_vid could not be retrieved" What am I doing wrong? Thx for answers.

Hmm. The error seems to be a mysql error. Can you go to the script and have it echo the query that is causing the problem?

Put some "debug code" in there to output what it's trying to do and maybe that will help figure out what the error is all about...

Also-- just making sure-- you're using Drupal 5.x and a new version of mysql right

W

we're a free german rock community and still running on phpnuke 5 which we desperately want to migrate to drupal as fast as possible. drupal is just awesome with its structure, flexibility and modules!

we've got over 20000 users with 500000 forum postings in 10000 topics.
unfortunately we're not programmer enough to get phpnuke's old crypt function translated to drupal 5 (i think md5).
would anybody be so kind and lead us into the right direction here in the comments? would it be possible to tweak the provided script?

thanks a million. hope you can help us somehow.

Both PHPNuke and Drupal use the same encryption (MD5) for the password in the database. So you can just move from one to the other. No salt or anything is used.

(this will need to be changed in the future, as MD5 is getting easier and easier to hack)

W

I'm usign the 0.02-w version, but I get some problems...

When I try to convert Stories, I get:
MySQL Error: Max ID for vocabulary_vid could not be retrieved

And when I try to convert Fora I get:
MySQL Error: Max ID for term_data_tid could not be retrieved

I don't understand why do I get this error. I've followed the instructions... :'(

Anyone can help me, please?

The error means that the script is unable to get some information from the database, namely the max_id records. The specific query that resulted in the error should be printed above the error itself. This should give you some idea of what the problem is (the field doesn't exist in the database, the data is not of the type expecte, etc. You should use phpmyadmin to see if you can figure out what is making the query go bonkers. If you can post the exact mysql error, someone here may be able to help you...

Unfortunately, the bit of code you're referring to is sort of complicated and was there before I started-- I tried to write everything that I did using the Drupal API (once i figured out it existed ;) )...

Good luck!

W

BTW, make sure you create a new forum as the instructions tell you or you will get errors as asked about above.

also...

I posted a bit of extra code w/explanation here for migrating web links from phpnuke to drupal, but as it requires CCK, CCK link field, and (optionally) taxonomy to migrate the link categories, I never included it in the script itself.

Still maybe someone will find it useful.

W

Also, I now posted code to migrate the reviews from phpnuke as well as the web links. That code is at the same location- a forum page at drupal.org.

Good luck all,

W

Hello,

I been able to migrate users and stories. My problem is my messageboard.
I have 10340 articles. After 30 minutes or so, and well pass the end of the green browser loading bar, my screen just froze.

Now I wanted to try again but it trys to start from the begining of the script. I used the // to take out some steps but I can't get passed the "Error transferring forum titles.. Exiting.. " error because it trys to migrate forum topics from the beginning.

Is there a way to make it continue from where it left off?

Thanks in advance.

From memory, you need to start again from the top. However, the next time around, try increasing the timeout in your php.ini beforehand.

best of luck :)

First I like to thank you for the quick response. I really appreciate it.

I set the php.ini settings before before I started. I set the time to 7200. I guess I will give it more time.

What is the proper way to restart? I mean, how should I clear the info in the database?

Thank again.
:o)

Ok. I made a fresh installation but I keep having the same problem. My php.ini file is set to high number and it keeps stopping around the same number of post in the "fora" process. I tried deleting that post and the one after it thinking it might be the problem but it still keeps stopping.

What can you suggest for me to do?

Thanks again for your time.

I really don't know, sorry. I wrote this a few years ago and barely remember anything about it.

It could be an encoding issue, I guess. There are a few different versions of this script floating about on the net; please check them as well.

FYI: I’ve created a module for drupal 6 that performs a migration using the drupal batch api. It is implemented from scratch, not based on current scripts and is easily customizable/extendable if you know php.

http://drupal.org/project/phpnuke2drupal

Pages