Advertisement:

Author Topic: Import Members from Profile Manager 3 to SMF  (Read 10515 times)

RCG

  • Guest
Import Members from Profile Manager 3 to SMF
« on: July 13, 2008, 10:41:05 AM »
I currently have 100+ users registered in my CGI database. The datafile is PM.DAT (flat file) and would like to import the user information into SMF. Any suggestions?

ThorstenE

  • Guest
Re: Import Members from Profile Manager 3 to SMF
« Reply #1 on: July 13, 2008, 12:19:48 PM »
can you post one line from the PM.DAT? it should not be very hard to import the users only..maybe it looks like this:
usernane##mail##passwort##...

RCG

  • Guest
Re: Import Members from Profile Manager 3 to SMF
« Reply #2 on: July 13, 2008, 12:30:41 PM »
Here is the example you requested - Line 1 = Header -- Line 2 = Data

login|ID|password|update_date|register_date|IP|sortable_register_date|sortable_update_date|firstname|lastname|email|sfx|seclvl|mbrno|mt|address|city|st|zip|home|cell|work|bday|membdate|ofc_brd|mailing|trainer|obed|agil|rally|puppy|helper|apprentice|level|photo|occupation|committee|hobbies|notes|news|quote|dues|dues_yr|ppr|keyfab|kf_dep|sponser1|sponser2|sbday|active
GriffithR|998853730|****|June 20, 2008|February 6, 2008|71.113.151.214|20081089|20081171|Robert|Griffith|r.c.griffith@verizon.net| |9|1989-2279|Family|9690 Windgate Dr.|Bloomington|IL|61705-5514|309-829-2279|309-530-5877| |Aug-12|Feb-1989| |yes|no|no|no|no|no|no|no| | |Retired - 1999, GTE (IT-Adv Systems Engineer) <img src=http://www.tckc.org/members/cgi/images/smilie_smile.gif border=0>|-Web Support#|Family, Dogs, Friends and the Web Site|Can't wait till Spring is here!|Nothing new, just enjoying life!|--it Happens!| | |GriffithR|3722401|5.00|Joyce Cline| |08/12|yes|

I primarily need the "login,password,email" data but would like to expand SMF data items if possible (not critical).

Thanks
RCG

Edit, Removed password
« Last Edit: July 13, 2008, 10:21:06 PM by SleePy »

ThorstenE

  • Guest
Re: Import Members from Profile Manager 3 to SMF
« Reply #3 on: July 13, 2008, 01:43:22 PM »
try this:
Code: (import_users.php) [Select]
<?php

$importfile 
"PM.DAT";
$escape "|";

require_once(
dirname(__FILE__) . '/Settings.php');

$db_connection mysql_connect($db_server$db_user$db_passwd);
$db mysql_select_db($db_name);
$import file($importfile);

//remove the first line (description of user data)
array_shift($import);


foreach (
$import as $lines) {
$users explode($escape,$lines);

$regdate strtotime($users['4']);

mysql_query("
INSERT IGNORE INTO 
{$db_prefix}members
(memberName, ID_GROUP, realName , passwd, dateRegistered, emailAddress)
VALUES ('
$users[0]', '0', '$users[0]' , '$users[2]','$regdate', '$users[10]' )");
}
mysql_close($db_connection);
echo 
'IMPORT COMPLETE!';
?>
save as import_users.php and upload to your SMF-Folder... copy the PM.DAT to SMF folder, after that call it from browser.. for example http://yoursite.com/import_users.php

This is a Quick'n'Dirty Solution without checking duplicates or correcting the stats. After import go to Admin - Forum Maintenance - Find and repair any errors and Recount all forum totals and statistics.

RCG

  • Guest
Re: Import Members from Profile Manager 3 to SMF
« Reply #4 on: July 13, 2008, 11:30:58 PM »
 ;D Thanks, worked just fine!

RCG

Offline pcshme

  • Semi-Newbie
  • *
  • Posts: 17
Re: Import Members from Profile Manager 3 to SMF
« Reply #5 on: December 03, 2008, 01:00:12 PM »
TE
thanks in advance for your help
in this example
does the php file want to see

"|" as the delimiter?
or  comma's as the delimiter?

trying to import my customer base into memebers

here's an example of what i tried without sucmess using your php app.

CHICAGO60617|0|200 PHARMACY|INC.|60617|12/3/2008|200pharmacy211@ameritech.net

i can make it comma delim,  or "string","string" 
etc

let me know
thanks
mike

ThorstenE

  • Guest
Re: Import Members from Profile Manager 3 to SMF
« Reply #6 on: December 03, 2008, 01:24:10 PM »
delimiter is the $escape = "|";
have you tried more than one line in your test?

the script above drops the first line (in profile manager the first line contains the column description)

remove:
Code: [Select]
array_shift($import);from the example script.

PS: If you already have a comma seperated list you can use phpMyAdmin for the import.

Offline ne-yola

  • Jr. Member
  • **
  • Posts: 162
Re: Import Members from Profile Manager 3 to SMF
« Reply #7 on: August 27, 2009, 09:09:59 AM »
hello,

I need a script like this, I have the email addresses of the users, and i need a script that would use thesame email address as username and create a default paswd for the users.

It would also send them a mail for the users stating their password

Pls help , am a novice