Last updated June 24, 2016. Created on August 25, 2002.
Edited by tulvit, jonhattan, add1sun, kika. Log in to edit this page.

There's a module to migrate from phpnuke to Drupal 6 at

There are also some migration scripts for Drupal 5 available here:

Related to those scripts there is some extra code with explanation for migrating web links from phpnuke to Drupal in a forum post.

Looking for support? Visit the forums, or join #drupal-support in IRC.


VValdo’s picture

there are a few versions of the script at the site referred to above. The latest is at

A common mistake is not creating a forum before running the script, so make sure you do that.


VValdo’s picture

I posted info/code on migrating web links and reviews as well (which require CCK). They both require using the phpnuke2drupal script above, CCK, the CCK "link" field, and the code is on this page.

Good luck.


VValdo’s picture

Looks like some improvements have been made to the .02 script (there is now a .04!)



mchrisneglia’s picture

First, I want to say THANK you so much Waldo for this awesome script (used version 4). It has saved a ton of time.

The CCK content/link/text/carbon-copy modules need to be enabled for links to import. The cck field schema imported without a hitch. Also good to mention that I didn't append to the main script, I just cut the head down to the first closing tag and added the new code for a second import script and it ran just fine, adopting the settings from the first (migrate.php) script.

For others trying this: I did run into problems, but here's some things I did to resolve them. I'd recommend you check your settings before proceeding with the script :

1) By default, my version of mysql 5 in windows had STRICT_TRANS_TABLE enabled on my development machine. I'd turn that crap off because the behavior of queries differs from previous versions of mysql, to our chagrin. Mostly because inserts that rely on autoincrement fields in the value with empty string '' to fail, so for example "INSERT INTO blah (autoid, uid) values ('', 45)" would mess up should this setting be in your my.ini file. No that's not a real query- I do know that.

2) When the our client's 3rd party developer made a snapshot of the DB (which is all we had), I had to string-replace all the 'latin1' collation and charset to 'utf8'. I also had to save the snapshot as utf8 without BOM. I used notepad++ because it's fast. This kept all the content, complete with markup, exactly the same in both DB's.

3) I was getting an out-of-range issue with regards to the UID field on inserts. This was because in the drupal DB the UID field is an int(11) which was too small to hold the number from nuke. So there were two ways to fix this, a bad way and a better way. The bad way was to do a dump of the drupal DB and change the int to an unsigned bigint with the dumpfile. They say don't hack core though, so the better (but harder) way was to fix the corresponding UID in the nuke snapshot. In order to do that though, I had to look around and subtract (max_users minus 1) from the UID that the script attempted to insert to find that exact number. Then I did a string replace in the nuke snapshot and restored this newly changed DB. This is a reversal of what the script tries to do safely (ie: so as not to overwrite any existing uid). In essence, the uid I had in nuke was too big to fit in an int field, so i turned it into like, uid '3'.

4) Finally, the best thing I did was have a pristine snapshot of the db by using 'backup and migrate' to restore the drupal db, on every fail. That made things much faster.

-- props to Alex S for helping out with this! Some think extreme programming is a waste of time. I say, heck no!

Fogg’s picture

Hi folks,

is there any script to migrate to Drupal6?

I tried waldo's version, but have couple of issues. Drupal 6 seems to use auto_increment whereas Drupal5 did not. I changed quite some pieces of the script and could get the users part to work. Stories somehow.... but they do not work afterwards. And fora.... no way. tons of issues.

Help please...


ComicsOnline’s picture

Did you ever find anything, Fogg?

I would love to import just all the 1208 news articles from my old site:
to the new site which is not pretty at the moment, but located at: which has about that many newer articles itself.
Is there anything that will do just that? I don't need users or anything else, just the news articles from the main page. Is there anything out there that will import in a situation like that? Ideally with dumbed-down documentation?

a secondary question:
Since I use different content types in Drupal for Reviews and News, and in PHPNuke they didn't get split out that way, I'm assuming that the easy way would be to pick one, import them all, then change them later, but I don't know how to change a post from one content type to another. I'm assuming that's possible, but I haven't seen a way besides manually creating a new one, then pasting the data in, then deleting the old one in the wrong content type.

Anyway, thanks, and I look forward to learning how to import to Drupal 6.15!

VValdo’s picture

Hmm. It's been literally years now since I worked on the script, but there's a discussion at Bogdan's site with relatively recent entries on Drupal 6 migration.

One of the things to consider if you're moving news without users is that every Story node (ie, migrated news article) you create had an owner-- maybe it was the administrator, but maybe it was someone else. So if you're migrating news stories, you'll need to have the associated users as the creators, unless you want them to be listed as anonymous or unconfirmed users. (The phpnuke2drupal script handled this for Drupal 5.x...) Now, if you have only a single person writing news stories (say, the Webmaster or anonymous or whatever), you could modify the script so that it automatically assigns userid 1 or whatever as the owner of all the nodes)...

If you don't care about the user issue, it shouldn't be too hard to just edit the part of the script that imports the news articles, and then change it to assign all the main page articles to a single existing Drupal user.

To take another approach, you could write a very VERY simple script that just sucks the article content from PhpNuke, cleans it up (using tidy to eliminate bad html) and then adds it to your existing site via the Drupal API.

Another complication:
You also may want to migrate comments to those news stories. The comments themselves in PHPNuke may be associated with users that may or may not exist in Drupal. Something to consider... Again, look at the code in phpnuke2drupal because it handled all that.

Something to note about that script is it originally was written with Drupal 4.7 in mind. When I made my revisions I started using the Drupal API when I could, rather than manipulating tables directly. But that's why much of it isn't so Drupal 6 friendly.

2nd question:

The reviews migration in my case certainly required CCK. I was able to migrate both weblinks and reviews. The code is there for you to look at.

Hope this helps and good luck!