De-bridging eFictio...
 
Notifications
Clear all

De-bridging eFiction and SMF (SQL help needed)

7 Posts
3 Users
0 Reactions
1,868 Views
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

So I'm going through and debridging the two parts of the site since the two won't play nice together on our server.

My brilliant plan is to wipe and then repopulate fanfiction_authors with the data from smf_members but I apparently fail miserably at writing SQL queries.

Could someone please help me write the correct queries for transferring data from:

ID_MEMBER from smf_members to UID from fanfiction_authors
member_name from smf_members to penname from fanfiction_authors
emailAddress from smf_members to email from fanfiction_authors
emailAddress from smf_members to email from fanfiction_authors
passwd from smf_members to password from fanfiction_authors

ETA: So, this query mostly worked

INSERT INTO fanfiction_authors (uid, penname, password, email) SELECT ID_MEMBER, memberName, passwd, emailAddress FROM smf_members

bit mySQL keeps insisting that 'password' is the command and not the column.


Skins made by Kali are no longer supported!

 
Posted : 12/03/2009 1:25 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

I'm not too familiar with a bridged site.  fanfiction_authors has the proper structure, but is completely empty, correct?

Also, you've got which version of MySQL? 5.0?

Have you tried using this: http://dev.mysql.com/doc/refman/5.0/en/insert-select.htm

Or in other words, maybe:

INSERT INTO fanfiction_authors (uid,penname,email,password) SELECT smf_members.ID_MEMBER,smf_members.member_name,smf_members.emailAddress,smf_members.passwd FROM smf_members

Very questionable, though... these examples all have multiple tables they're pulling from so they have a WHERE to account for that.  Not sure if it's necessary with a single table.


 
Posted : 12/03/2009 2:07 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Well, I'm not finding how to get around that in the documentation.  Why don't you rename the password column to like psswrd, run the query again, and then rename it back?


 
Posted : 12/03/2009 2:16 pm
 kali
(@kali)
Posts: 307
Reputable Member
Topic starter
 

Well, I'm not finding how to get around that in the documentation.  Why don't you rename the password column to like psswrd, run the query again, and then rename it back?

You and your crazy earth logic.

ETA:

Now the table is populated, but the password isn't working. I wonder if it's because of the 'password salt' thing in the SMF database.

Whatever, the users can reset their passwords.

Thanks!


Skins made by Kali are no longer supported!

 
Posted : 12/03/2009 2:16 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

LOL! One must be crafty when attempting to trick a machine.


 
Posted : 12/03/2009 2:18 pm
(@lyndsie)
Posts: 1263
Member Moderator
 

Yes, it looks like SMF encrypts their passwords differently.  I hope that doesn't lead to a bunch of duplicated accounts for you. :


 
Posted : 12/03/2009 2:26 pm
(@calash)
Posts: 180
Estimable Member
 

No way around the password issue outside of recoding eFiction to hash the password the same.  Best bet is to put up a notice and a link so people know right where to go so they can reset their passwords.


The World of Necrotania - Story Writing Community

 
Posted : 14/03/2009 9:55 am
Share: