I have been using ColdFusion to develope my business and my clients sites. My site, www.tecito.com, is using coldFusion.

I have a log in page, the passwords are stored as Hash() value(ColdFusion function to store passwords, one way only) in the password field in MySQL database, and the userName is just a text field. My question is, how do i convert that database to Drupal compatible, so existing users will be able to log in without any problems after i convert all my files and databases. Drupal can't read Hash() values, can it? Has anyone done something similar to this? Any ideas how to overcome this situation?

Thank you in advance!

Comments

johnhanley’s picture

I just did this exact thing, importing 100's of users from Access to MySQL for use with Drupal.

First, you'll need to become familiar with the structure of the Drupal MySQL table 'users'.

I use Excel as a intermediary tool for massaging the data.

Export the current table data as CVS and load it into Excel. Then build a relative list of INSERT statements to import the data into table 'users'. Be sure your statements include a incremented uid.

Once imported, you'll need to update the uid count in table 'sequences' to match the total number of records of 'users'.

As for the passwords, Cold Fusion hash() uses MD5 by default which is the same as Drupal. In theory converting the string passwords should be straightforward, assuming the MD5 algorithms are the same. If they are then you should be good to go. If they're not, converting them would not be a trivial thing and may not be worth the effort. It might be easier to simply have each user request a new password the first time they log into Drupal (assuming the email addresses on file are up-to-date.)

In any event, converting data isn't too complicated but it can be tedious and time-consuming. Make a backup of 'users' before importing just in case you screw something up and need to restore the original.

Good luck!

johnhanley’s picture

I should add that you also need to insert the proper role assignments for each corresponding new user in 'users_roles'. Typically this is '2' for 'authenticated user' and whatever custom roles you've defined.

sepeck’s picture

Subtle note UID (User ID)
UID0 is used in Drupal for anonymous users
UID1 is the first user admin account also used for site maintainence and upgrades.

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mountain

-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide

hectorplus’s picture

I just want to give you guys a big thank you for your suggestions, advices to my question. I have successfuly converted the database to Drupal users table.
My current members can actually log in using their coldfusion password!!

Thanks again.

Tecito.com
Comunidad Latina en Canada.