Support Forum

Customized importer

NO NorCal
NorCal
Member

when I am customizing the importer and mapping the origin database to the sp database what do I do when the origin data for one SP table comes from two different tables from the origin db?  So for example the sfposts table “post_id” and “topic_id” come from one table but “poster_ip” comes from another?

would I do two separate select/where like this ?

$map[‘tables’]->sfposts = true;
$map[‘sfposts’]->table = ‘origintable1’;
$map[‘sfposts’]->select = ”;
$map[‘sfposts’]->where = ”;
$map[‘sfposts’]->post_id = ‘msgid’;
$map[‘sfposts’]->topic_id = ‘threadid’;

$map[‘tables’]->sfposts = true;
$map[‘sfposts’]->table = ‘origintable2’;
$map[‘sfposts’]->select = ”;
$map[‘sfposts’]->where = ”;
$map[‘sfposts’]->poster_ip = ‘ipaddress’;

3 Answers

New Answer

SS SP Community Support
SP Community Support
Admin

Hi:

Take a look at the Asgaros or bbPress importer – they pull data from multiple tables using the SELECT and WHERE items in the map arrays. 

There’s a little bit of explanation in the CUSTOM VIEWS section at the bottom of this article that might help as well: https://simple-press.com/writing-custom-importers-for-simplepress/

NO NorCal
NorCal
Member

Hi,

Import script can’t find necessary function sp_create_member_data,  Any insights as to why can’t script find this function?

Fatal error: Uncaught Error: Call to undefined function sp_create_member_data() in /public_html/wp-content/plugins/sp-import/engine/spimport.php:435 Stack trace: #0 /public_html/wp-content/plugins/sp-import/engine/spimport.php(114): spi_create_user(Object(stdClass), Object(stdClass), Array, Array, false, Array) #1 /public_html/wp-content/plugins/sp-import/engine/spimport.php(49): spi_import_users(‘2’, Object(stdClass), Object(stdClass), Array) #2 {main} thrown in /public_html/wp-content/plugins/sp-import/engine/spimport.php on line 435

 
NO NorCal
NorCal
Member

can I please get some help with this?  I cannot use simplepress until I can migrate my forum.  I’m very frustrated.