News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

[RC1] import Custom Profile Fields from 1.1.8

Started by Vincent Volmer, February 12, 2009, 04:25:26 PM

Previous topic - Next topic

Vincent Volmer

Hello,

Couldn't find an answer somewhere in the forum so here's my question;

After upgrading my SMF1.1.8 forum to 2.0RC1 my Custom Profile Fields are gone. Although they can be add in SMF2.0RC1 but it doesn't shop-up the fields from 1.1.8
Is there a way to correct this (if it is a bug??) or import it in the users profile?.

I would appreciate if someone has an answer for that ;D

Thanks in advance,
Vincent
Digiscrap.nl

Vincent Volmer


Özgür

So Long

Propaganistas

Quote from: Özgür´ on February 17, 2009, 11:41:40 AM
How?

SMF 2.x has Custom Profile Fields as a default option now :)
Check Configuration > Basic Features > enable Custom Profile Fields

Özgür

Quote from: Propaganistas on February 17, 2009, 11:55:20 AM
Quote from: Özgür´ on February 17, 2009, 11:41:40 AM
How?

SMF 2.x has Custom Profile Fields as a default option now :)
Check Configuration > Basic Features > enable Custom Profile Fields

I know this. =) But i don't know how you can import 1.1.8 custom profile fields.
So thank you.
So Long

Propaganistas

You don't have to as it's already implemented...?

Özgür

No..    I wonder to how can to do. I have no idea for this but according to what you say 1.1.8 custom profile field and 2.0 Rc1 Custom fields are same. Am i right?
So Long

Vincent Volmer

#7
Quote from: Özgür´ on February 17, 2009, 11:41:40 AM

How?

I'll already put my solution in the dutch forum. this morning I'll translate it and put it here.

Quote from: Propaganistas on February 17, 2009, 02:35:10 PM
You don't have to as it's already implemented...?

The custom fields from v1.1.8 are not imported into the fields of SMF2 automatically. That's the point. And.... the fieldnames are not the same.....

Vincent

Vincent Volmer

#8
 
Hello,
Hereby my solution:

Note that this works in my situation. But I give no warranty or support. Damaging of your forum after the execution of the following is at your own risk and responsibility. Its also that I'm not a English language miracle......

The data of the custom fields is stored in the table smf_themes. The variables are named CP1 and CP2... etc (smf 1.1.x). First, export this table and remove all data without de value CP1, CP2 etc... Only keep the rules with the data from the custom fields, not the settings!

When you've don it you have something like this:
INSERT INTO `smf_themes` (`id_member`, `id_theme`, `variable`, `value`) VALUES
(1, 1, 'CP1', 'Hallo, ik ben wie ik ben. En jij bent?'),
(2, 1, 'CP1', 'Ik ben dus Anita'),
(1, 1, 'CP2', 'Ik maak geen layouts :-)'),
(2, 1, 'CP2', 'Photoshop CS4 NL<br />');


After this you need to add the profile fields in the smf2.0 install. Put any identifiable info into this fields for the first user (id1)!
After you add these fields, search the 'live smf2.0' databse in smf_themes for the matching values.

For example:

Field 1 (in my case): Stel je voor: gives in the table (smf_themes) stelje as variable.
Field 2 (in my case): Welke software gebruik jij: gives in the table (smf_themes) welkeso as variable.

Variable CP1 matched with stelje
Variable CP2 matched with welkeso

Rename the 'old, existing' variables (CP1 en CP2 ......) of the exported table to the new found variables.

For example, hereby a shorty from my own database:


INSERT INTO `smf_themes` (`id_member`, `id_theme`, `variable`, `value`) VALUES
(1, 1, 'stelje', 'Hallo, ik ben wie ik ben. En jij bent?'),
(2, 1, 'stelje', 'Ik ben dus Anita'),
(1, 1, 'welkeso', 'Ik maak geen layouts :-)'),
(2, 1, 'welkeso', 'Photoshop CS4 NL<br />');



Now, you can import this into the smf2.0 database...... For this you need to remove the 2 rules for id1 (otherwise you get an error that it allready exist...).

Vincent

Özgür

So Long

Tom Stephenson

I upgraded to version 2.0 the other day to get improved e-mail penetration to users.  When I upgraded the custom profile fields didn't show up in the upgrade.  I started to follow the instructions above, and found that in fact, all the custom field information was left intact in the SMF_Themes table. 

I got things working again a slightly different way:

1) I created custom profile fields for all the items that I had in the custom fields in the previous version using the SMF control panel.  This puts descriptive records into the smf_custom_fields table, one record for each field you add.    For example, in the old board I had a custom field that was for the Postal Code.  In that version the field was called CP_PostalCode.  I added a postal code field to the upgraded version of SMF and that put a record into smf_custom_fields table with the column name "postalc" or something to that effect.

2) Once new profile fields to match all the custom fields in the old version were added to the upgraded version, I went into the database using myPHPAdmin and manually modified the records in the smf_custom_fields table to have a Column Name the same as the original.  For example, the "postalc" column was simply renamed back to CP_PostalCode.  All the data then showed up in the profiles.

One other minor thing I had to change was to change the col_name data field structure from varchar(12) to varchar(18) to accommodate a couple of longer field names I had in the old version.

Have fun!
Tom

Advertisement: