Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 08-26-2010, 05:00 PM
codegrunt codegrunt is offline
 
Join Date: Jun 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Impex - extending beyond username, email, password for text import (CSV)

Howdy. I have a client that wants to import an existing CSV based user list which includes much more detail than what the default Impex text importer allows. Specifically, it includes custom profile field related data, address data, etc. while the default text importer only offers the 4 fields username, password, email and id.

Looking at the files associated with the text importer (000.php - 0002.php), this system does not actually work with full CSV files as it does not appear to have the concept of quoted strings or escaping. There are no calls to fgetcsv() for example. So contrary to some postings in the official forum, CSV format is not fully supported by this importer.

So it looks I need to roll a custom solution. Before I go off an adventure though I thought I would ask around to see if I can speed this process up.

My questions are:

1. is there a more fully fleshed out CSV based script(s) available for importing user data from CSV?

2. if not, are there any guides available covering how to approach a custom impex "system" file? Can I just copy "impex/systems/txt_file" to a new directory name and start editing or do I need to update all class definitions to have unique names, etc.?

3. do any of the board associated import scripts have a more fleshed out user import (including profile fields) that could be adapted for use with a custom CSV importer?

Any and all assistance here appreciated.

Cheers
Reply With Quote
  #2  
Old 09-14-2010, 09:02 PM
MOGmartin MOGmartin is offline
 
Join Date: Feb 2008
Location: London
Posts: 250
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi Codegrunt,

I cant help you on your quest, but I would like to add that I am also stumped on this one...

Im trying to import 8,000 users from an older system, CSV is my only route - and the damn thing doesnt work.

I am also interested in getting someone to help out on this, even as paid work.

thanks

MOGmartin

--------------- Added [DATE]1284503466[/DATE] at [TIME]1284503466[/TIME] ---------------

I would also like to add into this thread, that impex -> txt files is an absolute piece of f*****g s**t app.

After hours of playing around, I finally got it to work by RE-SAVING my text files in notepad, rather than excel.

Finished the import, got my users, albeit with only 1/10th of the data I really need, and guess what ---- all my forums have disappeared.

After 10 hours of trying to get this working, Im now really, really hacked off with vB.
Reply With Quote
  #3  
Old 09-14-2010, 10:21 PM
codegrunt codegrunt is offline
 
Join Date: Jun 2010
Posts: 2
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I ended up having to write something custom to get this working. My mod is pretty specific to my situation (predefined columns + some custom profile fields) but could potentially be adapted to others as long as we are just talking user related data and not forum related changes.

Essentially I cloned the txt import module and changed the class definitions to reflect the new name, rewrote the import process to use fgetcsv(), hardcoded the columns to the fields I was using and then hacked in some extra stuff to deal with the custom profile fields I needed.

I should note that that stock code for handling custom profile fields appears to be broken for 4.* as it assumes existence of a column called "title" in the profilefields table that does not actually exist. I worked around it by inserting data into the userfields table directly instead of relying on the Impex function for this purpose.

Anway, I was able to import 64 users without any obvious issues using my semi-custom version so it is possible to do with some work.

Cheers
Reply With Quote
  #4  
Old 07-27-2011, 02:01 AM
radiofranky radiofranky is offline
 
Join Date: Jun 2011
Posts: 149
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,
I would like to import csv to vb database(+10000 threads). i have column "forum id", "user name", "title", "post text", "post date". is there a sample sql scripts that can start play with?
Reply With Quote
  #5  
Old 10-31-2012, 12:07 PM
point4design point4design is offline
 
Join Date: Feb 2012
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I know I'm dredging up an old thread here, but I've searched and can't find an answer. I need to import from a CSV and I need to be able to import more than just the 3 basic columns of info. Does anyone have a script I can use for this?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:01 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07516 seconds
  • Memory Usage 2,196KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete