Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Trouble Exporting from Simple Press 5.34

Hi,
I've been trying to export an old forum that is running on Simple Press 5.34 using the exporter tool. I'm able to get an export file, but get the errors that I've posted below. Does anyone know what might be going wrong? I'm running Vanilla 2.0.18.8.

select *

     from wp_sfmessages
     where is_reply = 0;Table 'okgo_wp.wp_sfmessages' doesn't exist   

Notice: Table 'okgo_wp.wp_sfmessages' doesn't exist in /home/ethan/Sites/okgo/wp-content/vanilla2export.php on line 1293
select c.message_id as ConversationID, m.*
from wp_sfmessages c
join wp_sfmessages m
on (m.is_reply = 0 and m.message_id = c.message_id) or (m.is_reply = 1 and c.is_reply = 0 and m.message_slug = c.message_slug and m.from_id in (c.from_id, c.to_id) and m.to_id in (c.from_id, c.to_id));Table 'okgo_wp.wp_sfmessages' doesn't exist
Notice: Table 'okgo_wp.wp_sfmessages' doesn't exist in /home/ethan/Sites/okgo/wp-content/vanilla2export.php on line 1293
select message_id, from_id
from wp_sfmessages
where is_reply = 0
union
select message_id, to_id
from wp_sfmessages
where is_reply = 0;Table 'okgo_wp.wp_sfmessages' doesn't exist
Notice: Table 'okgo_wp.wp_sfmessages' doesn't exist in /home/ethan/Sites/okgo/wp-content/vanilla2export.php on line 1293

Tagged:
«134

Comments

  • You are using the Porter to port an unsupported forum. It only supports Simple Press 1.x.

    You should be able to figure out the mappings with some inspection of your tables.

    Any one here familiar with Simple Press 5?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • Hmmm. So I basically will need to modify the porter code myself? Has anyone else here done this already?? Would be great if so!!

  • Okay, so I commented out the section that seemed to be producing the error messages above and the thing ran without any other errors. But now I am unable to import it. When I run the importer it say it is in the wrong format. Any tips?

  • grep is your friend.

  • Solved that problem by decompressing the file using gunzip. Now I was able to start the import, but am getting a message: "Could not parse import file. The problem is near line 1."

  • I am not very familiar with the porter, but a search of the source code reveals that error is thrown in the import model.

    It thinks the export was malformed (which sounds about right). As far as going back to your original problem, would you mind sharing a dump of your simple forums db structure?

    Welcome to the community, btw.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight, sure, i assume you mean an sql w/ structure and no content? or do you just want a read-out?

  • I'm trying to understand how this code works. Each export process seems to be handled from a specific class that extends ExportController, is that right? But I can't find where these classes are actually instantiated. ..

  • @fraxture said:
    @hgtonight, sure, i assume you mean an sql w/ structure and no content? or do you just want a read-out?

    He does mean the Simple Forums database structure and no content.

    Add Pages to Vanilla with the Basic Pages app

  • @fraxture said:
    Each export process seems to be handled from a specific class that extends ExportController

    That's exactly right. Keep looking for that file with all those classes. Don't know where it is, but it's in there somewhere

    There was an error rendering this rich post.

  • Here's a pastebin of the simple press tables as a mysqldump sql file: http://pastebin.com/UZeiLseH

  • Looks like they changed the message table name to _sfpmmessages. Try replacing all occurrences (I count 5) of _sfmessages with _sfpmmessages in the porter and try exporting again.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight, I tried that already :(. I then got a second set of errors relating to field within those tables, which apparently ahve changed. I then tried to comment out the whole section relating to that table, since they are empty anyway in my forum. That worked. I was able to export the file, but when I tried to import I got this error, saying: ""Could not parse import file. The problem is near line 1."

  • Anyway, with regard to that table, I guess the field mappings need to be changed for SimplePress 5.*...but I'm not clear how.

    In the Vanilla Porter the relevant quote looks like this:

     // Conversation.
      $Conv_Map = array(
         'message_id' => 'ConversationID',
         'from_id' => 'InsertUserID',
         'sent_date' => 'DateInserted'
      );
      $Ex->ExportTable('Conversation',
         "select *
         from :_sfmessages
         where is_reply = 0", $Conv_Map);
    
      // ConversationMessage.
      $ConvMessage_Map = array(
         'message_id' => 'MessageID',
         'from_id' => 'InsertUserID',
         'message' => array('Column'=>'Body')
      );
      $Ex->ExportTable('ConversationMessage',
         'select c.message_id as ConversationID, m.*
         from :_sfmessages c
         join :_sfmessages m
           on (m.is_reply = 0 and m.message_id = c.message_id) or (m.is_reply = 1 and c.is_reply = 0 and m.message_slug = c.message_slug and m.from_id in (c.from_id, c.to_id) and m.to_id in (c.from_id, c.to_id));',
         $ConvMessage_Map);
    
      // UserConversation
      $UserConv_Map = array(
         'message_id' => 'ConversationID',
         'from_id' => 'UserID'
      );
      $Ex->ExportTable('UserConversation',
         'select message_id, from_id
         from :_sfmessages
         where is_reply = 0
    
         union
    
         select message_id, to_id
         from :_sfmessages
         where is_reply = 0',
         $UserConv_Map);
    

    The message_id, message, and sent_date fields seemed to have their equivalents, but the from_id is gone. In the new table dump for my SimplePress install there appear two tables that are not in the Vanilla Porter Export code, sfpmrecipients and sfpmthreads. See here:

     DROP TABLE IF EXISTS `wp_sfpmmessages`;
    /*!40101 SET @saved_cs_client     = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `wp_sfpmmessages` (
     `message_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
     `thread_id` BIGINT(20) DEFAULT NULL,
     `user_id` BIGINT(20) DEFAULT NULL,
     `sent_date` datetime DEFAULT NULL,
     `message` text,
     `attachment_id` BIGINT(20) DEFAULT NULL,
     PRIMARY KEY (`message_id`),
     KEY `THREAD` (`thread_id`),
     KEY `USER` (`user_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    /*!40101 SET character_set_client = @saved_cs_client */;
    
    --
    -- Table structure for table `wp_sfpmrecipients`
    --
    
    DROP TABLE IF EXISTS `wp_sfpmrecipients`;
    /*!40101 SET @saved_cs_client     = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `wp_sfpmrecipients` (
     `recipient_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
     `thread_id` BIGINT(20) DEFAULT NULL,
     `message_id` BIGINT(20) DEFAULT NULL,
     `user_id` BIGINT(20) DEFAULT NULL,
     `read_status` tinyint(1) DEFAULT NULL,
     `pm_type` INT(11) DEFAULT NULL,
     PRIMARY KEY (`recipient_id`),
      KEY `MESSAGE` (`message_id`),
      KEY `USER` (`user_id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
    /*!40101 SET character_set_client = @saved_cs_client */;
    
    --
    -- Table structure for table `wp_sfpmthreads`
    --
    
    DROP TABLE IF EXISTS `wp_sfpmthreads`;
    /*!40101 SET @saved_cs_client     = @@character_set_client */;
    /*!40101 SET character_set_client = utf8 */;
    CREATE TABLE `wp_sfpmthreads` (
      `thread_id` BIGINT(20) NOT NULL AUTO_INCREMENT,
      `title` VARCHAR(200) DEFAULT NULL,
      `thread_slug` text,
      `message_count` INT(11) DEFAULT NULL,
      PRIMARY KEY (`thread_id`)
    ) ENGINE=MyISAM AUTO_INCREMENT=199 DEFAULT CHARSET=utf8;
    /*!40101 SET character_set_client = @saved_cs_client */;
    

    So I wonder if the link between messages and users is in SimplePress 5.* being established relationally. Might require some more complex transformations to get it to fit into Vanilla 2?

  • peregrineperegrine MVP
    edited November 2013

    Stupid question - but are messages equivalent to discussions and comments or are they equivalent to messages in the inbox in vanilla.

    if they are equivalent to messages in inbox couldn't you just comment out the entire code, and you can live without inbox messages.

    related to export of the three tables in question.
    $Ex->ExportTable

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine, In fact that's a good idea. I tried that. Basically, I commented out the code posted above, but as noted in a previous message I got an error when I tried to import the file, saying that the file could not be parsed and that tehre was an error around line 1. But I couldnt' find any other debug info to figure out why the file could not be parsed. The file that the porter created appeared to be all in code...not sql or anything, so I couldn't figure out what the trouble is. Any tips about how to debug that error?

  • peregrineperegrine MVP
    edited November 2013

    I got an error when I tried to import the file, saying that the file could not be parsed and that tehre was an error around line 1.

    The file that the porter created appeared to be all in code

    can you post a snippet of the code starting from the first character. for a few lines or at least 1000 characters.

    I haven't used porter, btw.

    do you have a linux system and can you get to a console. to break the file up.

    if so you could do an od -bc and paste results.

    or

    head yourfilename

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine, sorry i mispoke the file was not in 'code' but rather in 'binary' -- i.e. not human language. here's a pastebin, the result of issuing the head command on the file. i wondered if perhaps the porter's output is not what it should be... hence the error at line 1?

  • I guess the key is to look at the code for import and see what it expects.

    unfortunately I use neither simplepress or porter. I could look at porter another day, but x00 and a few other people are experts with the porter process and what is expected even if it is a case of what your output looks like (binary seems pretty odd to me).

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Well, I hope x00 will chime in. Certainly, I'd love your assistance if you have a chance. Meanwhile, I'll keep plugging away at the problem. Binary seems strange to me too. I wish there were some documentation to explain what I should be getting. Guess I'll have to loook at the code more...

Sign In or Register to comment.